Skip to content

Commit

Permalink
CHANGES.rst and use imio.helpers HAS_PLONE5*
Browse files Browse the repository at this point in the history
  • Loading branch information
duchenean committed May 29, 2024
1 parent af434ed commit a12fd3b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 33 deletions.
7 changes: 4 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Changelog
=========

3.44 (unreleased)
-----------------
4.0 (unreleased)
----------------

- Nothing changed yet.
- Python 3, Plone 5.2 and Plone 6.0 compatible.
[aduchene]


3.43 (2024-04-10)
Expand Down
12 changes: 0 additions & 12 deletions buildout.d/plone-4.3.x.cfg

This file was deleted.

14 changes: 0 additions & 14 deletions src/collective/documentgenerator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@

VIEWLET_TYPES = ['PODTemplate', 'ConfigurablePODTemplate']

HAS_PLONE_4 = api.env.plone_version().startswith('4')
HAS_PLONE_5 = api.env.plone_version() > '5'
HAS_PLONE_5_1 = api.env.plone_version() > '5.1'
HAS_PLONE_5_2 = api.env.plone_version() > '5.2'
HAS_PLONE_6 = api.env.plone_version() > '6'

DEFAULT_OO_SERVER = u'localhost'
DEFAULT_OO_PORT = u"2002"
DEFAULT_PYTHON_UNO = u'/usr/bin/python3'
Expand All @@ -40,14 +34,6 @@
DEFAULT_CSV_STRING_DELIMITERS = {u"Double Quote": u'"', u"Single Quote": u"'"}


if HAS_PLONE_5_2:
from zope.deprecation import deprecation

import sys
sys.modules['collective.documentgenerator.demo.helper.ATDemoHelperView'] = \
deprecation.deprecated(deprecation, 'Archetypes was removed from Plone 5.2.')


def get_uno_path():
return api.portal.get_registry_record(
'collective.documentgenerator.browser.controlpanel.IDocumentGeneratorControlPanelSchema.uno_path'
Expand Down
7 changes: 3 additions & 4 deletions src/collective/documentgenerator/demo/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from collective.documentgenerator.helper import DXDocumentGenerationHelperView
from collective.documentgenerator.utils import translate as _
from DateTime import DateTime
from imio.helpers import HAS_PLONE_5
from imio.helpers import HAS_PLONE_5_2
from imio.helpers import HAS_PLONE_5_AND_MORE
from imio.pyutils.utils import safe_encode
from plone import api
from plone.app.textfield import RichText
Expand Down Expand Up @@ -41,7 +40,7 @@ def is_line_field(self, field_name):

def get_localized_field_name(self, field_name):
translation_domain = getUtility(ITranslationDomain, 'plone')
if not HAS_PLONE_5:
if not HAS_PLONE_5_AND_MORE:
properties = api.portal.get_tool('portal_properties')
target_language = properties.site_properties.default_language
else:
Expand Down Expand Up @@ -124,7 +123,7 @@ def _get_unlocalized_field_label(self, field_name):

def is_folderish(self):

if HAS_PLONE_5_2:
if HAS_PLONE_5_AND_MORE:
raise NotImplementedError("Archetypes was removed from Plone 5.2")
else:
from Products.Archetypes.interfaces.base import IBaseFolder
Expand Down

0 comments on commit a12fd3b

Please sign in to comment.