Skip to content

Commit

Permalink
provide Archetypes-only fallback if plone.uuid is not available, re…
Browse files Browse the repository at this point in the history
…storing compatibility with Plone 4.0.x

svn path=/plone.app.linkintegrity/trunk/; revision=52087
  • Loading branch information
witsch committed Sep 19, 2011
1 parent ff185f7 commit 15b0a3a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGES.txt
Expand Up @@ -4,6 +4,10 @@ Changelog
1.4.4 - unreleased
------------------

- Provide Archetypes-only fallback if `plone.uuid` is not available,
restoring compatibility with Plone 4.0.x.
[witsch]


1.4.3 - 2011-09-14
------------------
Expand Down Expand Up @@ -45,7 +49,7 @@ Changelog
1.4.0 - 2011-01-03
------------------

- Use plone.uuid to look up content UUIDs.
- Use `plone.uuid` to look up content UUIDs.
[toutpt, davisagli]


Expand Down
13 changes: 12 additions & 1 deletion plone/app/linkintegrity/info.py
@@ -1,8 +1,19 @@
from plone.app.linkintegrity.interfaces import ILinkIntegrityInfo
from zope.interface import implements
from zope.component import queryUtility
from Acquisition import aq_base
from Products.CMFCore.interfaces import IPropertiesTool
from plone.uuid.interfaces import IUUID

try:
from plone.uuid.interfaces import IUUID
IUUID # make pyflakes happy
except ImportError:
# Archetypes-only fallback for Plone < 4.1
def IUUID(obj, default=None):
if hasattr(aq_base(obj), 'UID'):
return obj.UID()
else:
return default


class LinkIntegrityInfo(object):
Expand Down
1 change: 0 additions & 1 deletion setup.py
Expand Up @@ -29,7 +29,6 @@
include_package_data=True,
install_requires=[
'setuptools',
'plone.uuid',
],
extras_require={'test': [
'collective.testcaselayer',
Expand Down

0 comments on commit 15b0a3a

Please sign in to comment.