Skip to content

Commit

Permalink
Provide forward compatibility for IPossibleSite interface
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Mar 2, 2013
1 parent 0584e95 commit 4d74906
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/OFS/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from zope.container.interfaces import IContainer
from zope.interface import Attribute
from zope.interface import Interface
from zope.location.interfaces import IPossibleSite
from zope.location.interfaces import IRoot
from zope.schema import Bool, BytesLine, Tuple

Expand All @@ -29,6 +28,12 @@
from webdav.interfaces import IDAVCollection
from webdav.interfaces import IDAVResource

# BBB
try:
from zope.component.interfaces import IPossibleSite
except ImportError:
from zope.location.interfaces import IPossibleSite


class IOrderedContainer(Interface):

Expand Down
11 changes: 10 additions & 1 deletion src/Products/Five/component/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import zope.component
import zope.event
from zope.component.interfaces import IComponentLookup
from zope.location.interfaces import ISite, IPossibleSite
from zope.traversing.interfaces import BeforeTraverseEvent

import ExtensionClass
Expand All @@ -27,10 +26,20 @@
from ZPublisher.BeforeTraverse import registerBeforeTraverse
from ZPublisher.BeforeTraverse import unregisterBeforeTraverse

# BBB
try:
from zope.component.interfaces import IPossibleSite
from zope.component.interfaces import ISite
except ImportError:
from zope.location.interfaces import IPossibleSite
from zope.location.interfaces import ISite


# Hook up custom component architecture calls
from zope.site.hooks import setHooks
setHooks()


def findSite(obj, iface=ISite):
"""Find a site by walking up the object hierarchy, supporting both
the ``ILocation`` API and Zope 2 Acquisition."""
Expand Down

0 comments on commit 4d74906

Please sign in to comment.