Skip to content

Commit

Permalink
[fc] Repository: plone.app.versioningbehavior
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2018-10-01T16:51:32+02:00
Author: Gil Forcada (gforcada) <gil.gnome@gmail.com>
Commit: plone/plone.app.versioningbehavior@4219665

Drop zope.app.intid dependency

Files changed:
M CHANGES.rst
M plone/app/versioningbehavior/tests/test_modifiers.py
M setup.py
Repository: plone.app.versioningbehavior

Branch: refs/heads/master
Date: 2018-10-03T18:06:04+02:00
Author: Alessandro Pisa (ale-rt) <alessandro.pisa@gmail.com>
Commit: plone/plone.app.versioningbehavior@f767bfc

Merge pull request #41 from plone/remove-z.a.intid-dep

Drop zope.app.intid dependency

Files changed:
M CHANGES.rst
M plone/app/versioningbehavior/tests/test_modifiers.py
M setup.py
  • Loading branch information
ale-rt committed Oct 3, 2018
1 parent caffb69 commit 98902ce
Showing 1 changed file with 18 additions and 67 deletions.
85 changes: 18 additions & 67 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,85 +1,36 @@
Repository: plone.app.upgrade
Repository: plone.app.versioningbehavior


Branch: refs/heads/master
Date: 2018-10-03T10:19:41+02:00
Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com>
Commit: https://github.com/plone/plone.app.upgrade/commit/78fb4ae59ddd40903f6065609e5dc8e582ac9cba
Date: 2018-10-01T16:51:32+02:00
Author: Gil Forcada (gforcada) <gil.gnome@gmail.com>
Commit: https://github.com/plone/plone.app.versioningbehavior/commit/421966544a49b41b820c7058a792c8f0713bf0cb

Do not break if archetypes are not available

Fixes #178

Files changed:
A news/178.bugfix
M plone/app/upgrade/v40/betas.py
D plone/app/upgrade/v40/profiles/to_beta4/types/File.xml
D plone/app/upgrade/v40/profiles/to_beta4/types/Image.xml

b'diff --git a/news/178.bugfix b/news/178.bugfix\nnew file mode 100644\nindex 00000000..cd1da0be\n--- /dev/null\n+++ b/news/178.bugfix\n@@ -0,0 +1 @@\n+Do not break if archetypes are not available\ndiff --git a/plone/app/upgrade/v40/betas.py b/plone/app/upgrade/v40/betas.py\nindex 1442ea93..5222dcf0 100644\n--- a/plone/app/upgrade/v40/betas.py\n+++ b/plone/app/upgrade/v40/betas.py\n@@ -3,6 +3,7 @@\n from plone.app.upgrade.utils import loadMigrationProfile\n from plone.app.upgrade.utils import logger\n from plone.app.upgrade.utils import updateIconsInBrains\n+from plone.dexterity.fti import DexterityFTI\n from Products.CMFCore.utils import getToolByName\n from Products.CMFPlone.CatalogTool import BLACKLISTED_INTERFACES\n from Products.CMFPlone.utils import safe_hasattr\n@@ -109,6 +110,15 @@ def beta3_beta4(context):\n loadMigrationProfile(\n context, \'profile-plone.app.upgrade.v40:4beta3-4beta4\')\n \n+ # Prepare for blob support\n+ pt = getToolByName(context, \'portal_types\')\n+ for portal_type in (\'Image\', \'File\'):\n+ fti = pt.get(portal_type)\n+ if fti and not isinstance(fti, DexterityFTI):\n+ fti.content_meta_type = \'ATBlob\'\n+ fti.product = \'plone.app.blob\'\n+ fti.factory = \'addATBlob{}\'.format(portal_type)\n+\n pprop = getToolByName(context, \'portal_properties\')\n site_properties = pprop.site_properties\n if site_properties.hasProperty(\'typesLinkToFolderContentsInFC\'):\ndiff --git a/plone/app/upgrade/v40/profiles/to_beta4/types/File.xml b/plone/app/upgrade/v40/profiles/to_beta4/types/File.xml\ndeleted file mode 100644\nindex f1a29db7..00000000\n--- a/plone/app/upgrade/v40/profiles/to_beta4/types/File.xml\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-<?xml version="1.0"?>\n-<object name="File"\n- meta_type="Factory-based Type Information with dynamic views">\n- <property name="content_meta_type">ATBlob</property>\n- <property name="product">plone.app.blob</property>\n- <property name="factory">addATBlobFile</property>\n-</object>\ndiff --git a/plone/app/upgrade/v40/profiles/to_beta4/types/Image.xml b/plone/app/upgrade/v40/profiles/to_beta4/types/Image.xml\ndeleted file mode 100644\nindex 0358ddfa..00000000\n--- a/plone/app/upgrade/v40/profiles/to_beta4/types/Image.xml\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-<?xml version="1.0"?>\n-<object name="Image"\n- meta_type="Factory-based Type Information with dynamic views">\n- <property name="content_meta_type">ATBlob</property>\n- <property name="product">plone.app.blob</property>\n- <property name="factory">addATBlobImage</property>\n-</object>\n'

Repository: plone.app.upgrade


Branch: refs/heads/master
Date: 2018-10-03T13:47:16+02:00
Author: Philip Bauer (pbauer) <bauer@starzel.de>
Commit: https://github.com/plone/plone.app.upgrade/commit/1323207231f3a84044178a09cfe3efa8fae8b35b

skip upgrade-step removeLargePloneFolder when there is no portal_factory

Files changed:
M plone/app/upgrade/v40/betas.py

b'diff --git a/plone/app/upgrade/v40/betas.py b/plone/app/upgrade/v40/betas.py\nindex 5222dcf0..d45456f5 100644\n--- a/plone/app/upgrade/v40/betas.py\n+++ b/plone/app/upgrade/v40/betas.py\n@@ -143,7 +143,9 @@ def removeLargePloneFolder(context):\n """Complete removal of Large Plone Folder\n (Most of it is accomplished by the profile.)\n """\n- ftool = getToolByName(context, \'portal_factory\')\n+ ftool = getToolByName(context, \'portal_factory\', None)\n+ if not ftool:\n+ return\n l = set(ftool.getFactoryTypes())\n if \'Large Plone Folder\' in l:\n l.remove(\'Large Plone Folder\')\n'

Repository: plone.app.upgrade


Branch: refs/heads/master
Date: 2018-10-03T16:13:16+02:00
Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com>
Commit: https://github.com/plone/plone.app.upgrade/commit/46d325ccb271645e5297d79a51d5732c0021ad62

Gracefully fail if plone.app.blobs is missing

Files changed:
M plone/app/upgrade/v40/betas.py

b'diff --git a/plone/app/upgrade/v40/betas.py b/plone/app/upgrade/v40/betas.py\nindex d45456f5..37049d00 100644\n--- a/plone/app/upgrade/v40/betas.py\n+++ b/plone/app/upgrade/v40/betas.py\n@@ -159,8 +159,14 @@ def convertToBlobs(context):\n removes objects to recreate them fresh, so in the end nothing is\n permanently removed.\n """\n+ try:\n+ from plone.app.blob.migrations import migrateATBlobFiles\n+ except ImportError:\n+ logger.info(\n+ \'Cannot migrate files to blobs because plone.app.blob is missing.\'\n+ )\n+ return\n logger.info(\'Started migration of files to blobs.\')\n- from plone.app.blob.migrations import migrateATBlobFiles\n sprop = getToolByName(context, \'portal_properties\').site_properties\n if sprop.hasProperty(\'enable_link_integrity_checks\'):\n ori_enable_link_integrity_checks = sprop.getProperty(\n'

Repository: plone.app.upgrade


Branch: refs/heads/master
Date: 2018-10-03T16:14:07+02:00
Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com>
Commit: https://github.com/plone/plone.app.upgrade/commit/dc8d48b5666f84f7a016c3a576e95203cf5a0bfe

Update changelog
Drop zope.app.intid dependency

Files changed:
M news/178.bugfix
M CHANGES.rst
M plone/app/versioningbehavior/tests/test_modifiers.py
M setup.py

b'diff --git a/news/178.bugfix b/news/178.bugfix\nindex cd1da0be..5045bd16 100644\n--- a/news/178.bugfix\n+++ b/news/178.bugfix\n@@ -1 +1,2 @@\n-Do not break if archetypes are not available\n+Do not break if archetypes related code is not available\n+[ale-rt, pbauer]\n'
b"diff --git a/CHANGES.rst b/CHANGES.rst\nindex 24d2105..a81df80 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -14,8 +14,8 @@ New features:\n \n Bug fixes:\n \n-- *add item here*\n-\n+- Remove (testing) dependency on zope.app.intid.\n+ [gforcada]\n \n 1.3.4 (2018-09-25)\n ------------------\ndiff --git a/plone/app/versioningbehavior/tests/test_modifiers.py b/plone/app/versioningbehavior/tests/test_modifiers.py\nindex 1a3c38e..56c27dd 100644\n--- a/plone/app/versioningbehavior/tests/test_modifiers.py\n+++ b/plone/app/versioningbehavior/tests/test_modifiers.py\n@@ -18,11 +18,11 @@\n from z3c.relationfield.schema import RelationChoice\n from z3c.relationfield.schema import RelationList\n from ZODB.interfaces import IBlob\n-from zope.app.intid.interfaces import IIntIds\n from zope.component import getUtility\n from zope.configuration import xmlconfig\n from zope.interface import alsoProvides\n from zope.interface import Interface\n+from zope.intid.interfaces import IIntIds\n \n import unittest\n \n@@ -210,10 +210,6 @@ def testRelations(self):\n )\n self.portal.portal_types._setObject('RelationsType', rel_fti)\n \n- # Setup IIntIds utility which is required for relations to work\n- from five.intid import site\n- from zope.app.intid.interfaces import IIntIds\n- site.add_intids(self.portal)\n intids = getUtility(IIntIds)\n \n source = createContentInContainer(self.portal, 'RelationsType')\n@@ -284,9 +280,6 @@ def register_RelationsType(self):\n )\n self.portal.portal_types._setObject('RelationsType', rel_fti)\n \n- # Setup IIntIds utility which is required for relations to work\n- site.add_intids(self.portal)\n-\n def testRelationsInBehaviors(self):\n self.register_RelationsType()\n intids = getUtility(IIntIds)\ndiff --git a/setup.py b/setup.py\nindex e47a2b4..5e8a170 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -15,7 +15,6 @@\n 'plone.app.dexterity',\n 'plone.app.testing',\n 'plone.namedfile[blobs]',\n- 'zope.app.intid',\n ]\n \n setup(\n"

Repository: plone.app.upgrade
Repository: plone.app.versioningbehavior


Branch: refs/heads/master
Date: 2018-10-03T17:12:12+02:00
Date: 2018-10-03T18:06:04+02:00
Author: Alessandro Pisa (ale-rt) <alessandro.pisa@gmail.com>
Commit: https://github.com/plone/plone.app.upgrade/commit/a90a0fed3551eff14fbe3d7786a4577da862c9d1
Commit: https://github.com/plone/plone.app.versioningbehavior/commit/f767bfccffa0522b772067eccec5f0d458021bee

Merge pull request #179 from plone/python3
Merge pull request #41 from plone/remove-z.a.intid-dep

Do not break if archetypes are not available
Drop zope.app.intid dependency

Files changed:
A news/178.bugfix
M plone/app/upgrade/v40/betas.py
D plone/app/upgrade/v40/profiles/to_beta4/types/File.xml
D plone/app/upgrade/v40/profiles/to_beta4/types/Image.xml
M CHANGES.rst
M plone/app/versioningbehavior/tests/test_modifiers.py
M setup.py

b'diff --git a/news/178.bugfix b/news/178.bugfix\nnew file mode 100644\nindex 00000000..5045bd16\n--- /dev/null\n+++ b/news/178.bugfix\n@@ -0,0 +1,2 @@\n+Do not break if archetypes related code is not available\n+[ale-rt, pbauer]\ndiff --git a/plone/app/upgrade/v40/betas.py b/plone/app/upgrade/v40/betas.py\nindex 1442ea93..37049d00 100644\n--- a/plone/app/upgrade/v40/betas.py\n+++ b/plone/app/upgrade/v40/betas.py\n@@ -3,6 +3,7 @@\n from plone.app.upgrade.utils import loadMigrationProfile\n from plone.app.upgrade.utils import logger\n from plone.app.upgrade.utils import updateIconsInBrains\n+from plone.dexterity.fti import DexterityFTI\n from Products.CMFCore.utils import getToolByName\n from Products.CMFPlone.CatalogTool import BLACKLISTED_INTERFACES\n from Products.CMFPlone.utils import safe_hasattr\n@@ -109,6 +110,15 @@ def beta3_beta4(context):\n loadMigrationProfile(\n context, \'profile-plone.app.upgrade.v40:4beta3-4beta4\')\n \n+ # Prepare for blob support\n+ pt = getToolByName(context, \'portal_types\')\n+ for portal_type in (\'Image\', \'File\'):\n+ fti = pt.get(portal_type)\n+ if fti and not isinstance(fti, DexterityFTI):\n+ fti.content_meta_type = \'ATBlob\'\n+ fti.product = \'plone.app.blob\'\n+ fti.factory = \'addATBlob{}\'.format(portal_type)\n+\n pprop = getToolByName(context, \'portal_properties\')\n site_properties = pprop.site_properties\n if site_properties.hasProperty(\'typesLinkToFolderContentsInFC\'):\n@@ -133,7 +143,9 @@ def removeLargePloneFolder(context):\n """Complete removal of Large Plone Folder\n (Most of it is accomplished by the profile.)\n """\n- ftool = getToolByName(context, \'portal_factory\')\n+ ftool = getToolByName(context, \'portal_factory\', None)\n+ if not ftool:\n+ return\n l = set(ftool.getFactoryTypes())\n if \'Large Plone Folder\' in l:\n l.remove(\'Large Plone Folder\')\n@@ -147,8 +159,14 @@ def convertToBlobs(context):\n removes objects to recreate them fresh, so in the end nothing is\n permanently removed.\n """\n+ try:\n+ from plone.app.blob.migrations import migrateATBlobFiles\n+ except ImportError:\n+ logger.info(\n+ \'Cannot migrate files to blobs because plone.app.blob is missing.\'\n+ )\n+ return\n logger.info(\'Started migration of files to blobs.\')\n- from plone.app.blob.migrations import migrateATBlobFiles\n sprop = getToolByName(context, \'portal_properties\').site_properties\n if sprop.hasProperty(\'enable_link_integrity_checks\'):\n ori_enable_link_integrity_checks = sprop.getProperty(\ndiff --git a/plone/app/upgrade/v40/profiles/to_beta4/types/File.xml b/plone/app/upgrade/v40/profiles/to_beta4/types/File.xml\ndeleted file mode 100644\nindex f1a29db7..00000000\n--- a/plone/app/upgrade/v40/profiles/to_beta4/types/File.xml\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-<?xml version="1.0"?>\n-<object name="File"\n- meta_type="Factory-based Type Information with dynamic views">\n- <property name="content_meta_type">ATBlob</property>\n- <property name="product">plone.app.blob</property>\n- <property name="factory">addATBlobFile</property>\n-</object>\ndiff --git a/plone/app/upgrade/v40/profiles/to_beta4/types/Image.xml b/plone/app/upgrade/v40/profiles/to_beta4/types/Image.xml\ndeleted file mode 100644\nindex 0358ddfa..00000000\n--- a/plone/app/upgrade/v40/profiles/to_beta4/types/Image.xml\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-<?xml version="1.0"?>\n-<object name="Image"\n- meta_type="Factory-based Type Information with dynamic views">\n- <property name="content_meta_type">ATBlob</property>\n- <property name="product">plone.app.blob</property>\n- <property name="factory">addATBlobImage</property>\n-</object>\n'
b"diff --git a/CHANGES.rst b/CHANGES.rst\nindex 24d2105..a81df80 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -14,8 +14,8 @@ New features:\n \n Bug fixes:\n \n-- *add item here*\n-\n+- Remove (testing) dependency on zope.app.intid.\n+ [gforcada]\n \n 1.3.4 (2018-09-25)\n ------------------\ndiff --git a/plone/app/versioningbehavior/tests/test_modifiers.py b/plone/app/versioningbehavior/tests/test_modifiers.py\nindex 1a3c38e..56c27dd 100644\n--- a/plone/app/versioningbehavior/tests/test_modifiers.py\n+++ b/plone/app/versioningbehavior/tests/test_modifiers.py\n@@ -18,11 +18,11 @@\n from z3c.relationfield.schema import RelationChoice\n from z3c.relationfield.schema import RelationList\n from ZODB.interfaces import IBlob\n-from zope.app.intid.interfaces import IIntIds\n from zope.component import getUtility\n from zope.configuration import xmlconfig\n from zope.interface import alsoProvides\n from zope.interface import Interface\n+from zope.intid.interfaces import IIntIds\n \n import unittest\n \n@@ -210,10 +210,6 @@ def testRelations(self):\n )\n self.portal.portal_types._setObject('RelationsType', rel_fti)\n \n- # Setup IIntIds utility which is required for relations to work\n- from five.intid import site\n- from zope.app.intid.interfaces import IIntIds\n- site.add_intids(self.portal)\n intids = getUtility(IIntIds)\n \n source = createContentInContainer(self.portal, 'RelationsType')\n@@ -284,9 +280,6 @@ def register_RelationsType(self):\n )\n self.portal.portal_types._setObject('RelationsType', rel_fti)\n \n- # Setup IIntIds utility which is required for relations to work\n- site.add_intids(self.portal)\n-\n def testRelationsInBehaviors(self):\n self.register_RelationsType()\n intids = getUtility(IIntIds)\ndiff --git a/setup.py b/setup.py\nindex 1aa4ec7..d659f80 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -15,7 +15,6 @@\n 'plone.app.dexterity',\n 'plone.app.testing',\n 'plone.namedfile[blobs]',\n- 'zope.app.intid',\n ]\n \n setup(\n"

0 comments on commit 98902ce

Please sign in to comment.