Skip to content
Browse files

Modernize more imports

svn path=/plone.app.relations/trunk/; revision=51256
  • Loading branch information...
1 parent 6500dd8 commit 67e52462738470faac90215560c49e1aca5b6cb4 @hannosch hannosch committed
View
27 plone/app/relations/configure.zcml
@@ -5,6 +5,8 @@
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
xmlns:zcml="http://namespaces.zope.org/zcml">
+ <five:registerPackage package="." initialize=".initialize" />
+
<include package="plone.relations" />
<include package="zope.annotation" />
@@ -44,7 +46,7 @@
<subscriber
handler=".subscribers.handleSourceTargetDelete"
for="persistent.IPersistent
- zope.app.intid.interfaces.IIntIdRemovedEvent"
+ zope.intid.interfaces.IIntIdRemovedEvent"
/>
<subscriber
handler=".subscribers.deleteReferenceOnSourceDelete"
@@ -66,28 +68,17 @@
for=".interfaces.IHoldingRelation
.interfaces.IRelationTargetDeleted"
/>
- <configure zcml:condition="installed zope.app.event">
- <subscriber
- handler=".subscribers.markCopyOnCopy"
- for="persistent.IPersistent
- zope.app.event.interfaces.IObjectCopiedEvent"
- />
- </configure>
- <configure zcml:condition="not-installed zope.app.event">
- <subscriber
- handler=".subscribers.markCopyOnCopy"
- for="persistent.IPersistent
- zope.lifecycleevent.interfaces.IObjectCopiedEvent"
- />
- </configure>
+ <subscriber
+ handler=".subscribers.markCopyOnCopy"
+ for="persistent.IPersistent
+ zope.lifecycleevent.interfaces.IObjectCopiedEvent"
+ />
<subscriber
handler=".subscribers.copyRelationsOnSourceCopy"
for=".interfaces.ICopyPendingAdd
- zope.app.intid.interfaces.IIntIdAddedEvent"
+ zope.intid.interfaces.IIntIdAddedEvent"
/>
- <five:registerPackage package="." initialize=".initialize" />
-
<class class="Products.CMFPlone.FactoryTool.TempFolder">
<implements interface=".interfaces.IFactoryTempFolder" />
</class>
View
8 plone/app/relations/interfaces.py
@@ -1,11 +1,7 @@
from zope.interface import Interface, Attribute, implements
from zope.annotation.interfaces import IAnnotatable
-try:
- from zope.component.interfaces import ObjectEvent
- from zope.component.interfaces import IObjectEvent
-except ImportError:
- from zope.app.event.objectevent import ObjectEvent
- from zope.app.event.interfaces import IObjectEvent
+from zope.component.interfaces import ObjectEvent
+from zope.component.interfaces import IObjectEvent
from plone.relations.interfaces import _marker, IStatefulRelationship
class TooManyResultsError(Exception):
View
2 plone/app/relations/tests.py
@@ -70,7 +70,7 @@ def base_setup(app):
from Products.Five.site.metaconfigure import classSiteHook
from Products.Five.site.localsite import FiveSite
from zope.interface import classImplements
- from zope.app.component.interfaces import IPossibleSite
+ from zope.site.interfaces import IPossibleSite
klass = app.__class__
classSiteHook(klass, FiveSite)
classImplements(klass, IPossibleSite)
View
13 plone/app/relations/userrelations.py
@@ -1,12 +1,12 @@
from zope.interface import implementer
from zope.component import adapter, getUtility
-from zope.app.intid.interfaces import IIntIds
+from zope.intid.interfaces import IIntIds
from plone.relations.interfaces import IRelatableProxy, IRelatableUnProxy
from Products.CMFCore.utils import getToolByName
from Products.PluggableAuthService.interfaces.authservice import IBasicUser
from Products.CMFCore.interfaces import IMemberData
from zope.annotation.interfaces import IAnnotations
-from zope.app.component.hooks import getSite
+from zope.site.hooks import getSite
USER_ANNOTATION = "plone.app.relations.memberdata_annotation"
@@ -16,9 +16,9 @@ def getUserRelatableProxy(user):
mtool = getToolByName(user, 'portal_membership')
memberdata = mtool.getMemberById(user.getId())
intids = getUtility(IIntIds)
- intid = intids.register(memberdata)
+ intids.register(memberdata)
annotation = IAnnotations(memberdata)
- userid = annotation.setdefault(USER_ANNOTATION, user.getId())
+ annotation.setdefault(USER_ANNOTATION, user.getId())
return memberdata
@implementer(IRelatableUnProxy)
@@ -27,8 +27,5 @@ def getUserFromProxy(proxy):
acl_user = getToolByName(getSite(), 'acl_users')
annotation = IAnnotations(proxy)
userid = annotation.get(USER_ANNOTATION)
- user = acl_user.getUserById(userid)
+ user = acl_user.getUserById(userid)
return user
-
-
-
View
4 plone/app/relations/utils.py
@@ -1,12 +1,12 @@
# Helpers for installing the utility in Zope < 2.10
-from zope.app.component.hooks import setSite, setHooks
+from zope.site.hooks import setSite, setHooks
from zope.component.interfaces import ComponentLookupError
from zope.component import getUtility
from five.intid.site import FiveIntIdsInstall, addUtility, add_intids
from five.intid.lsm import USE_LSM
from plone.relations import interfaces
from plone.relations.container import Z2RelationshipContainer
-from zope.app.intid.interfaces import IIntIds
+from zope.intid.interfaces import IIntIds
class RelationsInstall(FiveIntIdsInstall):
"""A view for adding the local utility"""
View
2 plone/app/relations/workflow.py
@@ -2,7 +2,7 @@
from Acquisition import aq_base
from zope.interface import implements
from zope.component import adapts
-from zope.app.component.hooks import getSite
+from zope.site.hooks import getSite
from plone.app.relations import interfaces
from plone.app.relations.annotations import ANNOTATIONS_KEY
from Products.CMFCore.utils import getToolByName
View
2 setup.py
@@ -26,6 +26,8 @@
install_requires=[
"setuptools",
"plone.relations",
+ "zope.site",
+ "zope.intid",
"Zope2 >= 2.13",
],
entry_points="""

0 comments on commit 67e5246

Please sign in to comment.
Something went wrong with that request. Please try again.