[CMF-checkins] SVN: CMF/trunk/CMFUid/ - some minor cleanup
Yvo Schubbe
y.2007- at wcm-solutions.de
Wed Dec 26 08:52:09 EST 2007
Log message for revision 82449:
- some minor cleanup
Changed:
U CMF/trunk/CMFUid/UniqueIdAnnotationTool.py
U CMF/trunk/CMFUid/interfaces.py
U CMF/trunk/CMFUid/tests/test_uidannotation.py
-=-
Modified: CMF/trunk/CMFUid/UniqueIdAnnotationTool.py
===================================================================
--- CMF/trunk/CMFUid/UniqueIdAnnotationTool.py 2007-12-26 13:49:26 UTC (rev 82448)
+++ CMF/trunk/CMFUid/UniqueIdAnnotationTool.py 2007-12-26 13:52:09 UTC (rev 82449)
@@ -18,7 +18,6 @@
"""
from AccessControl import ClassSecurityInfo
-from Acquisition import aq_base, aq_inner, aq_parent
from Acquisition import Implicit
from Globals import InitializeClass
from Globals import Persistent
@@ -69,8 +68,9 @@
InitializeClass(UniqueIdAnnotation)
+
def handleUidAnnotationEvent(ob, event):
- """ Event subscriber for (IUniqueIdAnnotation, IObjectEvent) events
+ """ Event subscriber for (IContentish, IObjectEvent) events
"""
if IObjectAddedEvent.providedBy(event):
@@ -108,7 +108,8 @@
if assign_on_clone:
# assign new uid
uid_handler.register(ob)
-
+
+
class UniqueIdAnnotationTool(UniqueObject, SimpleItem, PropertyManager):
__doc__ = __doc__ # copy from module
Modified: CMF/trunk/CMFUid/interfaces.py
===================================================================
--- CMF/trunk/CMFUid/interfaces.py 2007-12-26 13:49:26 UTC (rev 82448)
+++ CMF/trunk/CMFUid/interfaces.py 2007-12-26 13:52:09 UTC (rev 82449)
@@ -22,7 +22,6 @@
from zope.interface import Interface
from Products.CMFCore.interfaces import ICallableOpaqueItem
-from Products.CMFCore.interfaces import ICallableOpaqueItemEvents
class UniqueIdError(Exception):
Modified: CMF/trunk/CMFUid/tests/test_uidannotation.py
===================================================================
--- CMF/trunk/CMFUid/tests/test_uidannotation.py 2007-12-26 13:49:26 UTC (rev 82448)
+++ CMF/trunk/CMFUid/tests/test_uidannotation.py 2007-12-26 13:52:09 UTC (rev 82449)
@@ -21,17 +21,15 @@
import transaction
from AccessControl.SecurityManagement import newSecurityManager
from Acquisition import Implicit
-
+from OFS.Folder import Folder
from zope.component import getSiteManager
from zope.component import getUtility
from zope.interface import implements
from zope.interface.verify import verifyClass
-from Products.CMFCore.PortalFolder import PortalFolder
+from Products.CMFCore.interfaces import IContentish
from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.tests.base.testcase import SecurityTest
-from Products.CMFCore.tests.test_CMFCatalogAware import SimpleFolder
-from Products.CMFCore.tests.test_CMFCatalogAware import TheClass
from Products.CMFCore.tests.test_PortalFolder import _AllowedUser
from Products.CMFCore.tests.test_PortalFolder import _SensitiveSecurityPolicy
from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement
@@ -42,6 +40,11 @@
UID_ATTRNAME = 'cmf_uid'
+class TheClass(Folder):
+
+ implements(IContentish)
+
+
class DummyUniqueIdHandlerTool(Implicit):
implements(IUniqueIdHandler)
@@ -85,7 +88,7 @@
)
self.root._setObject('dummy', DummyContent(id='dummy'))
- self.root._setObject('site', SimpleFolder('site'))
+ self.root._setObject('site', Folder('site'))
transaction.savepoint(optimistic=True)
@@ -200,7 +203,7 @@
site = self.root.site
site._setObject('dummy', dummy)
annotation = self.root.portal_uidannotation(dummy, UID_ATTRNAME)
- self.root._setObject('folder1', SimpleFolder('folder1'))
+ self.root._setObject('folder1', Folder('folder1'))
transaction.savepoint(optimistic=True)
cookie = site.manage_copyObjects(ids=['dummy'])
@@ -216,7 +219,7 @@
site._setObject('dummy', dummy)
annotation = self.root.portal_uidannotation(dummy, UID_ATTRNAME)
self.root.portal_uidannotation.remove_on_add = False
- self.root._setObject('folder1', SimpleFolder('folder1'))
+ self.root._setObject('folder1', Folder('folder1'))
transaction.savepoint(optimistic=True)
cookie = site.manage_copyObjects(ids=['dummy'])
@@ -232,7 +235,7 @@
site._setObject('dummy', dummy)
annotation = self.root.portal_uidannotation(dummy, UID_ATTRNAME)
self.root.portal_uidannotation.remove_on_clone = False
- self.root._setObject('folder1', SimpleFolder('folder1'))
+ self.root._setObject('folder1', Folder('folder1'))
transaction.savepoint(optimistic=True)
cookie = site.manage_copyObjects(ids=['dummy'])
@@ -249,7 +252,7 @@
site._setObject('dummy', dummy)
annotation = self.root.portal_uidannotation(dummy, UID_ATTRNAME)
self.root.portal_uidannotation.assign_on_clone = True
- self.root._setObject('folder1', SimpleFolder('folder1'))
+ self.root._setObject('folder1', Folder('folder1'))
transaction.savepoint(optimistic=True)
cookie = site.manage_copyObjects(ids=['dummy'])
@@ -259,11 +262,11 @@
self.failIf( annotation() == new_annotation() )
def test_simulateNestedFolderCloneRemovingUid1(self):
- self.root.site._setObject( 'foo', SimpleFolder(id='foo') )
- self.root.site._setObject( 'foo2', SimpleFolder(id='foo2') )
+ self.root.site._setObject( 'foo', Folder(id='foo') )
+ self.root.site._setObject( 'foo2', Folder(id='foo2') )
foo = self.root.site.foo
- foo._setObject( 'sub1', SimpleFolder(id='sub1') )
- foo.sub1._setObject( 'sub2', SimpleFolder(id='sub2') )
+ foo._setObject( 'sub1', Folder(id='sub1') )
+ foo.sub1._setObject( 'sub2', Folder(id='sub2') )
foo.sub1.sub2._setObject( 'baz', DummyContent(id='baz', catalog=1) )
baz = foo.sub1.sub2.baz
annotation = self.root.portal_uidannotation(baz, UID_ATTRNAME)
More information about the CMF-checkins
mailing list