Commit 4d749067 authored by Hanno Schlichting's avatar Hanno Schlichting

Provide forward compatibility for IPossibleSite interface

parent 0584e95e
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
from zope.container.interfaces import IContainer from zope.container.interfaces import IContainer
from zope.interface import Attribute from zope.interface import Attribute
from zope.interface import Interface from zope.interface import Interface
from zope.location.interfaces import IPossibleSite
from zope.location.interfaces import IRoot from zope.location.interfaces import IRoot
from zope.schema import Bool, BytesLine, Tuple from zope.schema import Bool, BytesLine, Tuple
...@@ -29,6 +28,12 @@ from persistent.interfaces import IPersistent ...@@ -29,6 +28,12 @@ from persistent.interfaces import IPersistent
from webdav.interfaces import IDAVCollection from webdav.interfaces import IDAVCollection
from webdav.interfaces import IDAVResource from webdav.interfaces import IDAVResource
# BBB
try:
from zope.component.interfaces import IPossibleSite
except ImportError:
from zope.location.interfaces import IPossibleSite
class IOrderedContainer(Interface): class IOrderedContainer(Interface):
......
...@@ -18,7 +18,6 @@ import zope.interface ...@@ -18,7 +18,6 @@ import zope.interface
import zope.component import zope.component
import zope.event import zope.event
from zope.component.interfaces import IComponentLookup from zope.component.interfaces import IComponentLookup
from zope.location.interfaces import ISite, IPossibleSite
from zope.traversing.interfaces import BeforeTraverseEvent from zope.traversing.interfaces import BeforeTraverseEvent
import ExtensionClass import ExtensionClass
...@@ -27,10 +26,20 @@ from Products.SiteAccess.AccessRule import AccessRule ...@@ -27,10 +26,20 @@ from Products.SiteAccess.AccessRule import AccessRule
from ZPublisher.BeforeTraverse import registerBeforeTraverse from ZPublisher.BeforeTraverse import registerBeforeTraverse
from ZPublisher.BeforeTraverse import unregisterBeforeTraverse 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 # Hook up custom component architecture calls
from zope.site.hooks import setHooks from zope.site.hooks import setHooks
setHooks() setHooks()
def findSite(obj, iface=ISite): def findSite(obj, iface=ISite):
"""Find a site by walking up the object hierarchy, supporting both """Find a site by walking up the object hierarchy, supporting both
the ``ILocation`` API and Zope 2 Acquisition.""" the ``ILocation`` API and Zope 2 Acquisition."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment