Skip to content

Commit

Permalink
[fc] Repository: plone.session
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2019-04-12T12:06:39+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.session@832ad30

Fix nameclash resulting in ImportWarning

Files changed:
A news/16.bugfix
A plone/session/hiddenprofiles.py
M plone/session/profiles.zcml
D plone/session/profiles.py
Repository: plone.session

Branch: refs/heads/master
Date: 2019-04-12T14:52:22+02:00
Author: agitator (agitator) <agitator@users.noreply.github.com>
Commit: plone/plone.session@91eb04b

Merge pull request #16 from plone/jensens/fix-importwarning

Fix nameclash resulting in ImportWarning

Files changed:
A news/16.bugfix
A plone/session/hiddenprofiles.py
M plone/session/profiles.zcml
D plone/session/profiles.py
  • Loading branch information
agitator committed Apr 12, 2019
1 parent 75418e5 commit 5ade599
Showing 1 changed file with 20 additions and 35 deletions.
55 changes: 20 additions & 35 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,53 +1,38 @@
Repository: plone.app.dexterity
Repository: plone.session


Branch: refs/heads/master
Date: 2019-04-09T11:18:03+02:00
Date: 2019-04-12T12:06:39+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: https://github.com/plone/plone.app.dexterity/commit/5e8a9c2973ce9843e78ddfdbfc457e6a9ff056a6
Commit: https://github.com/plone/plone.session/commit/832ad30df0590dc62740de6e75a0c77fc359ff5f

Revert "Revert "reflect moves from plone.app.widgets to plone.app.z3cform""
Fix nameclash resulting in ImportWarning

Files changed:
A news/268.feature
M plone/app/dexterity/factories.py
M plone/app/dexterity/permissions.py
M plone/app/dexterity/tests/test_permissions.py
A news/16.bugfix
A plone/session/hiddenprofiles.py
M plone/session/profiles.zcml
D plone/session/profiles.py

b"diff --git a/news/268.feature b/news/268.feature\nnew file mode 100644\nindex 0000000..b12ea31\n--- /dev/null\n+++ b/news/268.feature\n@@ -0,0 +1,3 @@\n+``IWidgetsLayer`` is no longer needed, use ``IPloneFormLayer`` instead.\n+Import ``IFieldPermissionChecker`` from ``plone.app.z3cform`` instead of ``plone.app.widgets``.\n+[jensens]\ndiff --git a/plone/app/dexterity/factories.py b/plone/app/dexterity/factories.py\nindex ce89521..0499e07 100644\n--- a/plone/app/dexterity/factories.py\n+++ b/plone/app/dexterity/factories.py\n@@ -11,8 +11,6 @@\n from zope.container.interfaces import INameChooser\n from zope.interface import implementer\n \n-import transaction\n-\n \n upload_lock = allocate_lock()\n \ndiff --git a/plone/app/dexterity/permissions.py b/plone/app/dexterity/permissions.py\nindex 4e3355a..f10d334 100644\n--- a/plone/app/dexterity/permissions.py\n+++ b/plone/app/dexterity/permissions.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n from AccessControl import getSecurityManager\n-from plone.app.widgets.interfaces import IFieldPermissionChecker\n-from plone.app.widgets.interfaces import IWidgetsLayer\n+from plone.app.z3cform.interfaces import IFieldPermissionChecker\n+from plone.app.z3cform.interfaces import IPloneFormLayer\n from plone.autoform.interfaces import WIDGETS_KEY\n from plone.autoform.interfaces import WRITE_PERMISSIONS_KEY\n from plone.autoform.utils import resolveDottedName\n@@ -21,7 +21,7 @@\n import six\n \n \n-@implementer(IWidgetsLayer)\n+@implementer(IPloneFormLayer)\n class MockRequest(TestRequest):\n pass\n \ndiff --git a/plone/app/dexterity/tests/test_permissions.py b/plone/app/dexterity/tests/test_permissions.py\nindex 355fc1b..62e6545 100644\n--- a/plone/app/dexterity/tests/test_permissions.py\n+++ b/plone/app/dexterity/tests/test_permissions.py\n@@ -4,7 +4,7 @@\n from plone.app.testing import setRoles\n from plone.app.testing import TEST_USER_ID\n from plone.app.testing import TEST_USER_NAME\n-from plone.app.widgets.interfaces import IWidgetsLayer\n+from plone.app.z3cform.interfaces import IPloneFormLayer\n from plone.app.widgets.testing import PLONEAPPWIDGETS_DX_INTEGRATION_TESTING\n from plone.autoform.interfaces import WIDGETS_KEY\n from plone.autoform.interfaces import WRITE_PERMISSIONS_KEY\n@@ -52,6 +52,7 @@ class IMockSchema(Interface):\n custom_widget_field = schema.TextLine()\n adapted_widget_field = schema.TextLine()\n \n+\n IMockSchema.setTaggedValue(WRITE_PERMISSIONS_KEY, {\n 'allowed_field': u'zope2.View',\n 'disallowed_field': u'zope2.ViewManagementScreens',\n@@ -66,14 +67,14 @@ class IMockSchema(Interface):\n def _enable_custom_widget(field):\n provideAdapter(\n _custom_field_widget,\n- adapts=(getSpecification(field), IWidgetsLayer),\n+ adapts=(getSpecification(field), IPloneFormLayer),\n provides=IFieldWidget\n )\n \n \n def _disable_custom_widget(field):\n base.unregisterAdapter(\n- required=(getSpecification(field), IWidgetsLayer, ),\n+ required=(getSpecification(field), IPloneFormLayer, ),\n provided=IFieldWidget,\n )\n \n"
b'diff --git a/news/16.bugfix b/news/16.bugfix\nnew file mode 100644\nindex 0000000..8cee411\n--- /dev/null\n+++ b/news/16.bugfix\n@@ -0,0 +1 @@\n+Fix nameclash resulting in ImportWarning by renaming ``profiles.py`` to ``hiddenprofiles.py``. [jensens]\n\\ No newline at end of file\ndiff --git a/plone/session/profiles.py b/plone/session/hiddenprofiles.py\nsimilarity index 100%\nrename from plone/session/profiles.py\nrename to plone/session/hiddenprofiles.py\ndiff --git a/plone/session/profiles.zcml b/plone/session/profiles.zcml\nindex 3fb4152..0e44fa2 100644\n--- a/plone/session/profiles.zcml\n+++ b/plone/session/profiles.zcml\n@@ -29,7 +29,7 @@\n \n <utility\n name="plone.session"\n- factory=".profiles.HiddenProfiles"\n+ factory=".hiddenprofiles.HiddenProfiles"\n />\n \n </configure>\n'

Repository: plone.app.dexterity
Repository: plone.session


Branch: refs/heads/master
Date: 2019-04-11T11:14:08+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: https://github.com/plone/plone.app.dexterity/commit/76208457b123fc854b3bbbb7b8c516f8d1be8e64

make IFieldPermissionChecker bbb for 5.1

Files changed:
M plone/app/dexterity/permissions.py

b'diff --git a/plone/app/dexterity/permissions.py b/plone/app/dexterity/permissions.py\nindex f10d334..8f71294 100644\n--- a/plone/app/dexterity/permissions.py\n+++ b/plone/app/dexterity/permissions.py\n@@ -1,6 +1,5 @@\n # -*- coding: utf-8 -*-\n from AccessControl import getSecurityManager\n-from plone.app.z3cform.interfaces import IFieldPermissionChecker\n from plone.app.z3cform.interfaces import IPloneFormLayer\n from plone.autoform.interfaces import WIDGETS_KEY\n from plone.autoform.interfaces import WRITE_PERMISSIONS_KEY\n@@ -20,6 +19,12 @@\n \n import six\n \n+try:\n+ from plone.app.z3cform.interfaces import IFieldPermissionChecker\n+except ImportError:\n+ # bbb for < plone 5.2rc2\n+ from plone.app.widgets.interfaces import IFieldPermissionChecker\n+\n \n @implementer(IPloneFormLayer)\n class MockRequest(TestRequest):\n'

Repository: plone.app.dexterity


Branch: refs/heads/master
Date: 2019-04-11T14:04:57+02:00
Author: Philip Bauer (pbauer) <bauer@starzel.de>
Commit: https://github.com/plone/plone.app.dexterity/commit/badd6839a6ae5381b441a839deecb67615705d5e
Date: 2019-04-12T14:52:22+02:00
Author: agitator (agitator) <agitator@users.noreply.github.com>
Commit: https://github.com/plone/plone.session/commit/91eb04bde5f6d62973fc0fdbf8275d3b3a0534be

Merge pull request #288 from plone/revert-287-revert-286-jensens/fixPloneFormLayer
Merge pull request #16 from plone/jensens/fix-importwarning

Revert "Revert "reflect moves from plone.app.widgets to plone.app.z3cform""
Fix nameclash resulting in ImportWarning

Files changed:
A news/268.feature
M plone/app/dexterity/factories.py
M plone/app/dexterity/permissions.py
M plone/app/dexterity/tests/test_permissions.py
A news/16.bugfix
A plone/session/hiddenprofiles.py
M plone/session/profiles.zcml
D plone/session/profiles.py

b"diff --git a/news/268.feature b/news/268.feature\nnew file mode 100644\nindex 0000000..b12ea31\n--- /dev/null\n+++ b/news/268.feature\n@@ -0,0 +1,3 @@\n+``IWidgetsLayer`` is no longer needed, use ``IPloneFormLayer`` instead.\n+Import ``IFieldPermissionChecker`` from ``plone.app.z3cform`` instead of ``plone.app.widgets``.\n+[jensens]\ndiff --git a/plone/app/dexterity/factories.py b/plone/app/dexterity/factories.py\nindex ce89521..0499e07 100644\n--- a/plone/app/dexterity/factories.py\n+++ b/plone/app/dexterity/factories.py\n@@ -11,8 +11,6 @@\n from zope.container.interfaces import INameChooser\n from zope.interface import implementer\n \n-import transaction\n-\n \n upload_lock = allocate_lock()\n \ndiff --git a/plone/app/dexterity/permissions.py b/plone/app/dexterity/permissions.py\nindex 4e3355a..8f71294 100644\n--- a/plone/app/dexterity/permissions.py\n+++ b/plone/app/dexterity/permissions.py\n@@ -1,7 +1,6 @@\n # -*- coding: utf-8 -*-\n from AccessControl import getSecurityManager\n-from plone.app.widgets.interfaces import IFieldPermissionChecker\n-from plone.app.widgets.interfaces import IWidgetsLayer\n+from plone.app.z3cform.interfaces import IPloneFormLayer\n from plone.autoform.interfaces import WIDGETS_KEY\n from plone.autoform.interfaces import WRITE_PERMISSIONS_KEY\n from plone.autoform.utils import resolveDottedName\n@@ -20,8 +19,14 @@\n \n import six\n \n+try:\n+ from plone.app.z3cform.interfaces import IFieldPermissionChecker\n+except ImportError:\n+ # bbb for < plone 5.2rc2\n+ from plone.app.widgets.interfaces import IFieldPermissionChecker\n \n-@implementer(IWidgetsLayer)\n+\n+@implementer(IPloneFormLayer)\n class MockRequest(TestRequest):\n pass\n \ndiff --git a/plone/app/dexterity/tests/test_permissions.py b/plone/app/dexterity/tests/test_permissions.py\nindex 355fc1b..62e6545 100644\n--- a/plone/app/dexterity/tests/test_permissions.py\n+++ b/plone/app/dexterity/tests/test_permissions.py\n@@ -4,7 +4,7 @@\n from plone.app.testing import setRoles\n from plone.app.testing import TEST_USER_ID\n from plone.app.testing import TEST_USER_NAME\n-from plone.app.widgets.interfaces import IWidgetsLayer\n+from plone.app.z3cform.interfaces import IPloneFormLayer\n from plone.app.widgets.testing import PLONEAPPWIDGETS_DX_INTEGRATION_TESTING\n from plone.autoform.interfaces import WIDGETS_KEY\n from plone.autoform.interfaces import WRITE_PERMISSIONS_KEY\n@@ -52,6 +52,7 @@ class IMockSchema(Interface):\n custom_widget_field = schema.TextLine()\n adapted_widget_field = schema.TextLine()\n \n+\n IMockSchema.setTaggedValue(WRITE_PERMISSIONS_KEY, {\n 'allowed_field': u'zope2.View',\n 'disallowed_field': u'zope2.ViewManagementScreens',\n@@ -66,14 +67,14 @@ class IMockSchema(Interface):\n def _enable_custom_widget(field):\n provideAdapter(\n _custom_field_widget,\n- adapts=(getSpecification(field), IWidgetsLayer),\n+ adapts=(getSpecification(field), IPloneFormLayer),\n provides=IFieldWidget\n )\n \n \n def _disable_custom_widget(field):\n base.unregisterAdapter(\n- required=(getSpecification(field), IWidgetsLayer, ),\n+ required=(getSpecification(field), IPloneFormLayer, ),\n provided=IFieldWidget,\n )\n \n"
b'diff --git a/news/16.bugfix b/news/16.bugfix\nnew file mode 100644\nindex 0000000..8cee411\n--- /dev/null\n+++ b/news/16.bugfix\n@@ -0,0 +1 @@\n+Fix nameclash resulting in ImportWarning by renaming ``profiles.py`` to ``hiddenprofiles.py``. [jensens]\n\\ No newline at end of file\ndiff --git a/plone/session/profiles.py b/plone/session/hiddenprofiles.py\nsimilarity index 100%\nrename from plone/session/profiles.py\nrename to plone/session/hiddenprofiles.py\ndiff --git a/plone/session/profiles.zcml b/plone/session/profiles.zcml\nindex 3fb4152..0e44fa2 100644\n--- a/plone/session/profiles.zcml\n+++ b/plone/session/profiles.zcml\n@@ -29,7 +29,7 @@\n \n <utility\n name="plone.session"\n- factory=".profiles.HiddenProfiles"\n+ factory=".hiddenprofiles.HiddenProfiles"\n />\n \n </configure>\n'

0 comments on commit 5ade599

Please sign in to comment.