Skip to content

Commit

Permalink
Merge pull request #44 from plone/davisagli-AT-cleanup
Browse files Browse the repository at this point in the history
remove hard dependency on Archetypes (again)
  • Loading branch information
jensens authored Oct 22, 2016
2 parents 3d93974 + a08d2a2 commit de15b7e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Bug fixes:
- Add coding headers on python files.
[gforcada]

- Remove hard dependency on Archetypes (again).
[davisagli]


3.0.7 (2016-09-16)
------------------
Expand Down
14 changes: 14 additions & 0 deletions plone/app/linkintegrity/compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# If Archetypes is not installed, define dummy objects
# to replace Archetypes imports.

try:
from Products.Archetypes.interfaces import IBaseObject
from Products.Archetypes.Field import TextField
except ImportError:
from zope.interface import Interface

class IBaseObject(Interface):
pass

class TextField(object):
pass
2 changes: 1 addition & 1 deletion plone/app/linkintegrity/handlers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from Acquisition import aq_get
from Acquisition import aq_parent
from Products.Archetypes.interfaces import IBaseObject
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.interfaces import IPloneSiteRoot
from ZODB.POSException import ConflictError
Expand All @@ -19,6 +18,7 @@
from zope.intid.interfaces import IIntIds
from zope.keyreference.interfaces import NotYet
from zope.publisher.interfaces import NotFound as ztkNotFound
from .compat import IBaseObject
import logging

logger = logging.getLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions plone/app/linkintegrity/retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
from plone.app.linkintegrity.parser import extractLinks
from zope.component import adapter
from zope.interface import implementer
from Products.Archetypes.Field import TextField
from Products.Archetypes.interfaces import IBaseObject
from plone.dexterity.interfaces import IDexterityContent
from zope.component import getUtility
from plone.dexterity.interfaces import IDexterityFTI
from plone.dexterity.utils import getAdditionalSchemata
from zope.schema import getFieldsInOrder
from plone.app.textfield import RichText
from .compat import IBaseObject
from .compat import TextField


@implementer(IRetriever)
Expand Down

0 comments on commit de15b7e

Please sign in to comment.