[Zope-Checkins] SVN: Zope/trunk/lib/python/ Zope2 Interfaces
package delenda est\!
Tres Seaver
tseaver at palladion.com
Mon Apr 28 11:19:00 EDT 2008
Log message for revision 85817:
Zope2 Interfaces package delenda est\!
Changed:
U Zope/trunk/lib/python/App/ProductContext.py
U Zope/trunk/lib/python/HelpSys/APIHelpTopic.py
D Zope/trunk/lib/python/Interface/
U Zope/trunk/lib/python/OFS/DTMLDocument.py
U Zope/trunk/lib/python/OFS/DTMLMethod.py
U Zope/trunk/lib/python/OFS/Folder.py
D Zope/trunk/lib/python/OFS/IOrderSupport.py
U Zope/trunk/lib/python/OFS/Image.py
U Zope/trunk/lib/python/OFS/OrderSupport.py
U Zope/trunk/lib/python/OFS/OrderedFolder.py
U Zope/trunk/lib/python/OFS/PropertySheets.py
U Zope/trunk/lib/python/OFS/tests/testFileAndImage.py
U Zope/trunk/lib/python/OFS/tests/testFolder.py
U Zope/trunk/lib/python/OFS/tests/testOrderSupport.py
U Zope/trunk/lib/python/OFS/tests/testOrderedFolder.py
A Zope/trunk/lib/python/OFS/tests/test_DTMLDocument.py
A Zope/trunk/lib/python/OFS/tests/test_DTMLMethod.py
D Zope/trunk/lib/python/Products/Five/bridge.py
U Zope/trunk/lib/python/Products/Five/doc/manual.txt
U Zope/trunk/lib/python/Products/Five/fiveconfigure.py
U Zope/trunk/lib/python/Products/Five/meta.zcml
D Zope/trunk/lib/python/Products/Five/tests/bridge.txt
D Zope/trunk/lib/python/Products/Five/tests/test_bridge.py
U Zope/trunk/lib/python/Products/Five/viewlet/metaconfigure.py
U Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py
U Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
U Zope/trunk/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
U Zope/trunk/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
U Zope/trunk/lib/python/Products/PluginIndexes/FieldIndex/FieldIndex.py
U Zope/trunk/lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py
U Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
U Zope/trunk/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py
U Zope/trunk/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py
U Zope/trunk/lib/python/Products/PluginIndexes/__init__.py
D Zope/trunk/lib/python/Products/PluginIndexes/common/PluggableIndex.py
U Zope/trunk/lib/python/Products/PluginIndexes/common/UnIndex.py
U Zope/trunk/lib/python/Products/PythonScripts/PythonScript.py
U Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py
U Zope/trunk/lib/python/Products/Sessions/BrowserIdManager.py
U Zope/trunk/lib/python/Products/Sessions/SessionDataManager.py
U Zope/trunk/lib/python/Products/Sessions/SessionInterfaces.py
D Zope/trunk/lib/python/Products/Sessions/help/SessionInterfaces.py
U Zope/trunk/lib/python/Products/Transience/Transience.py
U Zope/trunk/lib/python/Products/Transience/TransienceInterfaces.py
U Zope/trunk/lib/python/Products/Transience/TransientObject.py
U Zope/trunk/lib/python/Products/ZCTextIndex/BaseIndex.py
U Zope/trunk/lib/python/Products/ZCTextIndex/CosineIndex.py
U Zope/trunk/lib/python/Products/ZCTextIndex/HTMLSplitter.py
U Zope/trunk/lib/python/Products/ZCTextIndex/IIndex.py
D Zope/trunk/lib/python/Products/ZCTextIndex/ILexicon.py
U Zope/trunk/lib/python/Products/ZCTextIndex/INBest.py
U Zope/trunk/lib/python/Products/ZCTextIndex/IPipelineElement.py
U Zope/trunk/lib/python/Products/ZCTextIndex/IPipelineElementFactory.py
U Zope/trunk/lib/python/Products/ZCTextIndex/IQueryParseTree.py
U Zope/trunk/lib/python/Products/ZCTextIndex/IQueryParser.py
U Zope/trunk/lib/python/Products/ZCTextIndex/ISplitter.py
U Zope/trunk/lib/python/Products/ZCTextIndex/Lexicon.py
U Zope/trunk/lib/python/Products/ZCTextIndex/NBest.py
U Zope/trunk/lib/python/Products/ZCTextIndex/OkapiIndex.py
U Zope/trunk/lib/python/Products/ZCTextIndex/ParseTree.py
U Zope/trunk/lib/python/Products/ZCTextIndex/PipelineFactory.py
U Zope/trunk/lib/python/Products/ZCTextIndex/QueryParser.py
U Zope/trunk/lib/python/Products/ZCTextIndex/ZCTextIndex.py
U Zope/trunk/lib/python/Products/ZCTextIndex/tests/testLexicon.py
A Zope/trunk/lib/python/Products/ZCTextIndex/tests/testParseTree.py
U Zope/trunk/lib/python/Products/ZCTextIndex/tests/testPipelineFactory.py
U Zope/trunk/lib/python/Products/ZCTextIndex/tests/testQueryParser.py
U Zope/trunk/lib/python/Products/ZCTextIndex/tests/testZCTextIndex.py
D Zope/trunk/lib/python/Products/ZCatalog/IZCatalog.py
U Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py
U Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py
U Zope/trunk/lib/python/Products/ZCatalog/ZCatalogIndexes.py
U Zope/trunk/lib/python/Products/ZCatalog/tests/testCatalog.py
U Zope/trunk/lib/python/Products/ZSQLMethods/SQL.py
A Zope/trunk/lib/python/Products/ZSQLMethods/tests/
A Zope/trunk/lib/python/Products/ZSQLMethods/tests/__init__.py
A Zope/trunk/lib/python/Products/ZSQLMethods/tests/test_SQL.py
U Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py
U Zope/trunk/lib/python/ZPublisher/HTTPRangeSupport.py
U Zope/trunk/lib/python/ZPublisher/Iterators.py
U Zope/trunk/lib/python/ZPublisher/tests/testIterators.py
U Zope/trunk/lib/python/ZServer/HTTPResponse.py
U Zope/trunk/lib/python/ZServer/tests/test_responses.py
U Zope/trunk/lib/python/webdav/EtagSupport.py
U Zope/trunk/lib/python/webdav/LockItem.py
U Zope/trunk/lib/python/webdav/Lockable.py
U Zope/trunk/lib/python/webdav/NullResource.py
U Zope/trunk/lib/python/webdav/Resource.py
D Zope/trunk/lib/python/webdav/WriteLockInterface.py
U Zope/trunk/lib/python/webdav/davcmds.py
U Zope/trunk/lib/python/webdav/tests/testEtagSupport.py
U Zope/trunk/lib/python/webdav/tests/testLockItem.py
U Zope/trunk/lib/python/webdav/tests/testNullResource.py
-=-
Modified: Zope/trunk/lib/python/App/ProductContext.py
===================================================================
--- Zope/trunk/lib/python/App/ProductContext.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/App/ProductContext.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -28,7 +28,6 @@
from FactoryDispatcher import FactoryDispatcher
from DateTime import DateTime
-from Interface.Implements import instancesOfObjectImplements
from zope.interface import implementedBy
import ZClasses # to enable 'PC.registerBaseClass()'
@@ -183,8 +182,6 @@
interfaces = ()
else:
interfaces = tuple(implementedBy(instance_class))
- # BBB: Will be removed in Zope 2.11.
- interfaces += tuple(instancesOfObjectImplements(instance_class))
Products.meta_types=Products.meta_types+(
{ 'name': meta_type or instance_class.meta_type,
Modified: Zope/trunk/lib/python/HelpSys/APIHelpTopic.py
===================================================================
--- Zope/trunk/lib/python/HelpSys/APIHelpTopic.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/HelpSys/APIHelpTopic.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -26,13 +26,6 @@
_ignore_objects = {}
-try:
- import Interface
- _ignore_objects.update(Interface.__dict__)
-except ImportError:
- pass
-
-
class APIHelpTopic(HelpTopic.HelpTopic):
""" Provides API documentation.
"""
Modified: Zope/trunk/lib/python/OFS/DTMLDocument.py
===================================================================
--- Zope/trunk/lib/python/OFS/DTMLDocument.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/DTMLDocument.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -22,7 +22,6 @@
from PropertyManager import PropertyManager
from webdav.common import rfc1123_date
from webdav.Lockable import ResourceLockedError
-from webdav.WriteLockInterface import WriteLockInterface
from sgmllib import SGMLParser
from urllib import quote
from AccessControl import getSecurityManager
@@ -38,7 +37,6 @@
"""DTML Document objects are DocumentTemplate.HTML objects that act
as methods whose 'self' is the DTML Document itself."""
- __implements__ = (WriteLockInterface,)
meta_type='DTML Document'
icon ='p_/dtmldoc'
Modified: Zope/trunk/lib/python/OFS/DTMLMethod.py
===================================================================
--- Zope/trunk/lib/python/OFS/DTMLMethod.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/DTMLMethod.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -24,7 +24,6 @@
from AccessControl.Role import RoleManager
from webdav.common import rfc1123_date
from webdav.Lockable import ResourceLockedError
-from webdav.WriteLockInterface import WriteLockInterface
from ZDOM import ElementWithTitle
from DateTime.DateTime import DateTime
from urllib import quote
@@ -56,8 +55,6 @@
index_html=None # Prevent accidental acquisition
_cache_namespace_keys=()
- __implements__ = (WriteLockInterface,)
-
security = ClassSecurityInfo()
security.declareObjectProtected(View)
Modified: Zope/trunk/lib/python/OFS/Folder.py
===================================================================
--- Zope/trunk/lib/python/OFS/Folder.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/Folder.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -24,7 +24,6 @@
from AccessControl.Permissions import add_page_templates
from AccessControl.Permissions import add_user_folders
from Globals import DTMLFile
-from webdav.WriteLockInterface import WriteLockInterface
from zope.interface import implements
import FindSupport
@@ -84,7 +83,6 @@
a management interface and can have arbitrary properties.
"""
- __implements__ = (WriteLockInterface,)
implements(IFolder)
meta_type='Folder'
Deleted: Zope/trunk/lib/python/OFS/IOrderSupport.py
===================================================================
--- Zope/trunk/lib/python/OFS/IOrderSupport.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/IOrderSupport.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,28 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" Order support interfaces.
-
-$Id$
-"""
-
-
-# create IOrderedContainer
-from Interface.bridge import createZope3Bridge
-from OFS.interfaces import IOrderedContainer as z3IOrderedContainer
-import IOrderSupport
-
-createZope3Bridge(z3IOrderedContainer, IOrderSupport, 'IOrderedContainer')
-
-del createZope3Bridge
-del z3IOrderedContainer
-del IOrderSupport
Modified: Zope/trunk/lib/python/OFS/Image.py
===================================================================
--- Zope/trunk/lib/python/OFS/Image.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/Image.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -16,6 +16,8 @@
"""
import struct
from zope.contenttype import guess_content_type
+from zope.interface import implementedBy
+from zope.interface import implements
from Globals import DTMLFile
from Globals import InitializeClass
from PropertyManager import PropertyManager
@@ -27,8 +29,8 @@
from AccessControl.Permissions import ftp_access
from AccessControl.Permissions import delete_objects
from webdav.common import rfc1123_date
+from webdav.interfaces import IWriteLock
from webdav.Lockable import ResourceLockedError
-from webdav.WriteLockInterface import WriteLockInterface
from SimpleItem import Item_w__name__
from cStringIO import StringIO
from Globals import Persistent
@@ -77,7 +79,15 @@
RoleManager, Item_w__name__, Cacheable):
"""A File object is a content object for arbitrary files."""
- __implements__ = (WriteLockInterface, HTTPRangeSupport.HTTPRangeInterface)
+ implements(implementedBy(Persistent),
+ implementedBy(Implicit),
+ implementedBy(PropertyManager),
+ implementedBy(RoleManager),
+ implementedBy(Item_w__name__),
+ implementedBy(Cacheable),
+ IWriteLock,
+ HTTPRangeSupport.HTTPRangeInterface,
+ )
meta_type='File'
security = ClassSecurityInfo()
@@ -726,7 +736,6 @@
as File objects. Images also have a string representation that
renders an HTML 'IMG' tag.
"""
- __implements__ = (WriteLockInterface,)
meta_type='Image'
security = ClassSecurityInfo()
Modified: Zope/trunk/lib/python/OFS/OrderSupport.py
===================================================================
--- Zope/trunk/lib/python/OFS/OrderSupport.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/OrderSupport.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -26,8 +26,7 @@
from zope.interface import implements
from zope.app.container.contained import notifyContainerModified
-from interfaces import IOrderedContainer as z3IOrderedContainer
-from IOrderSupport import IOrderedContainer as z2IOrderedContainer
+from interfaces import IOrderedContainer as IOrderedContainer
from ObjectManager import ObjectManager
@@ -41,8 +40,7 @@
is totally user-specific.
"""
- __implements__ = z2IOrderedContainer
- implements(z3IOrderedContainer)
+ implements(IOrderedContainer)
security = ClassSecurityInfo()
has_order_support = 1
Modified: Zope/trunk/lib/python/OFS/OrderedFolder.py
===================================================================
--- Zope/trunk/lib/python/OFS/OrderedFolder.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/OrderedFolder.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -66,9 +66,6 @@
""" Extends the default Folder by order support.
"""
-
- __implements__ = (OrderSupport.__implements__,
- Folder.__implements__)
implements(IOrderedFolder)
meta_type='Folder (Ordered)'
Modified: Zope/trunk/lib/python/OFS/PropertySheets.py
===================================================================
--- Zope/trunk/lib/python/OFS/PropertySheets.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/PropertySheets.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -16,7 +16,6 @@
"""
import time, App.Management, Globals, sys
from webdav.interfaces import IWriteLock
-from webdav.WriteLockInterface import WriteLockInterface
from ZPublisher.Converters import type_converters
from Globals import InitializeClass
from Globals import DTMLFile, MessageDialog
@@ -585,8 +584,7 @@
def dav__supportedlock(self):
vself = self.v_self()
out = '\n'
- if IWriteLock.providedBy(vself) or \
- WriteLockInterface.isImplementedBy(vself):
+ if IWriteLock.providedBy(vself):
out += (' <n:lockentry>\n'
' <d:lockscope><d:exclusive/></d:lockscope>\n'
' <d:locktype><d:write/></d:locktype>\n'
@@ -599,8 +597,7 @@
vself = self.v_self()
out = '\n'
- if IWriteLock.providedBy(vself) or \
- WriteLockInterface.isImplementedBy(vself):
+ if IWriteLock.providedBy(vself):
locks = vself.wl_lockValues(killinvalids=1)
for lock in locks:
Modified: Zope/trunk/lib/python/OFS/tests/testFileAndImage.py
===================================================================
--- Zope/trunk/lib/python/OFS/tests/testFileAndImage.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/tests/testFileAndImage.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -243,14 +243,14 @@
self.assertEqual(len(results), 1)
self.assertEqual(results[0][1], self.file)
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
+ def test_z3interfaces(self):
+ from zope.interface.verify import verifyClass
from OFS.Image import File
- from webdav.WriteLockInterface import WriteLockInterface
+ from webdav.interfaces import IWriteLock
from ZPublisher.HTTPRangeSupport import HTTPRangeInterface
verifyClass(HTTPRangeInterface, File)
- verifyClass(WriteLockInterface, File)
+ verifyClass(IWriteLock, File)
def testUnicode(self):
val = u'some unicode string here'
@@ -287,12 +287,12 @@
def testViewImageOrFile(self):
pass # dtml method,screw it
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
+ def test_z3interfaces(self):
+ from zope.interface.verify import verifyClass
from OFS.Image import Image
- from webdav.WriteLockInterface import WriteLockInterface
+ from webdav.interfaces import IWriteLock
- verifyClass(WriteLockInterface, Image)
+ verifyClass(IWriteLock, Image)
def test_suite():
return unittest.TestSuite((
Modified: Zope/trunk/lib/python/OFS/tests/testFolder.py
===================================================================
--- Zope/trunk/lib/python/OFS/tests/testFolder.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/tests/testFolder.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -3,13 +3,6 @@
class TestFolder(unittest.TestCase):
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
- from OFS.Folder import Folder
- from webdav.WriteLockInterface import WriteLockInterface
-
- verifyClass(WriteLockInterface, Folder)
-
def test_z3interfaces(self):
from OFS.Folder import Folder
from OFS.interfaces import IFolder
Modified: Zope/trunk/lib/python/OFS/tests/testOrderSupport.py
===================================================================
--- Zope/trunk/lib/python/OFS/tests/testOrderSupport.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/tests/testOrderSupport.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -42,13 +42,6 @@
f.o4 = DummyObject('o4', 'mt2')
return f
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
- from OFS.IOrderSupport import IOrderedContainer
- from OFS.OrderSupport import OrderSupport
-
- verifyClass(IOrderedContainer, OrderSupport)
-
def test_z3interfaces(self):
from OFS.interfaces import IOrderedContainer
from OFS.OrderSupport import OrderSupport
Modified: Zope/trunk/lib/python/OFS/tests/testOrderedFolder.py
===================================================================
--- Zope/trunk/lib/python/OFS/tests/testOrderedFolder.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/OFS/tests/testOrderedFolder.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -3,15 +3,6 @@
class TestOrderedFolder(unittest.TestCase):
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
- from OFS.IOrderSupport import IOrderedContainer
- from OFS.OrderedFolder import OrderedFolder
- from webdav.WriteLockInterface import WriteLockInterface
-
- verifyClass(IOrderedContainer, OrderedFolder)
- verifyClass(WriteLockInterface, OrderedFolder)
-
def test_z3interfaces(self):
from OFS.interfaces import IOrderedContainer
from OFS.interfaces import IOrderedFolder
Added: Zope/trunk/lib/python/OFS/tests/test_DTMLDocument.py
===================================================================
--- Zope/trunk/lib/python/OFS/tests/test_DTMLDocument.py (rev 0)
+++ Zope/trunk/lib/python/OFS/tests/test_DTMLDocument.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -0,0 +1,24 @@
+import unittest
+
+class DTMLDocumentTests(unittest.TestCase):
+
+ def _getTargetClass(self):
+ from OFS.DTMLDocument import DTMLDocument
+ return DTMLDocument
+
+ def _makeOne(self, *args, **kw):
+ return self._getTargetClass()(*args, **kw)
+
+ def test_class_conforms_to_IWriteLock(self):
+ from zope.interface.verify import verifyClass
+ from webdav.interfaces import IWriteLock
+ verifyClass(IWriteLock, self._getTargetClass())
+
+
+def test_suite():
+ return unittest.TestSuite((
+ unittest.makeSuite(DTMLDocumentTests),
+ ))
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
Added: Zope/trunk/lib/python/OFS/tests/test_DTMLMethod.py
===================================================================
--- Zope/trunk/lib/python/OFS/tests/test_DTMLMethod.py (rev 0)
+++ Zope/trunk/lib/python/OFS/tests/test_DTMLMethod.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -0,0 +1,24 @@
+import unittest
+
+class DTMLMethodTests(unittest.TestCase):
+
+ def _getTargetClass(self):
+ from OFS.DTMLMethod import DTMLMethod
+ return DTMLMethod
+
+ def _makeOne(self, *args, **kw):
+ return self._getTargetClass()(*args, **kw)
+
+ def test_class_conforms_to_IWriteLock(self):
+ from zope.interface.verify import verifyClass
+ from webdav.interfaces import IWriteLock
+ verifyClass(IWriteLock, self._getTargetClass())
+
+
+def test_suite():
+ return unittest.TestSuite((
+ unittest.makeSuite(DTMLMethodTests),
+ ))
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
Deleted: Zope/trunk/lib/python/Products/Five/bridge.py
===================================================================
--- Zope/trunk/lib/python/Products/Five/bridge.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Five/bridge.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,89 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" Z2 -> Z3 bridge utilities.
-
-$Id$
-"""
-from Interface._InterfaceClass import Interface as Z2_InterfaceClass
-from Interface import Interface as Z2_Interface
-from Interface import Attribute as Z2_Attribute
-from Interface.Method import Method as Z2_Method
-
-from zope.interface.interface import InterfaceClass as Z3_InterfaceClass
-from zope.interface.interface import Interface as Z3_Interface
-from zope.interface.interface import Attribute as Z3_Attribute
-from zope.interface.interface import Method as Z3_Method
-
-_bridges = {Z2_Interface: Z3_Interface}
-
-def fromZ2Interface(z2i):
- """ Return a Zope 3 interface corresponding to 'z2i'.
-
- o 'z2i' must be a Zope 2 interface.
- """
- if not isinstance(z2i, Z2_InterfaceClass):
- raise ValueError, 'Not a Zope 2 interface!'
-
- if z2i in _bridges:
- return _bridges[z2i]
-
- name = z2i.getName()
- bases = [ fromZ2Interface(x) for x in z2i.getBases() ]
- attrs = {}
-
- for k, v in z2i.namesAndDescriptions():
- if isinstance(v, Z2_Method):
- v = fromZ2Method(v)
-
- elif isinstance(v, Z2_Attribute):
- v = fromZ2Attribute(v)
-
- attrs[k] = v
-
- # XXX: Note that we pass the original interface's __module__;
- # we may live to regret that.
- z3i = Z3_InterfaceClass(name=name,
- bases=tuple(bases),
- attrs=attrs,
- __doc__=z2i.getDoc(),
- __module__=z2i.__module__)
- _bridges[z2i] = z3i
- return z3i
-
-def fromZ2Attribute(z2a):
- """ Return a Zope 3 interface attribute corresponding to 'z2a'.
-
- o 'z2a' must be a Zope 2 interface attribute.
- """
- if not isinstance(z2a, Z2_Attribute):
- raise ValueError, 'Not a Zope 2 interface attribute!'
-
- return Z3_Attribute(z2a.getName(), z2a.getDoc())
-
-def fromZ2Method(z2m):
- """ Return a Zope 3 interface method corresponding to 'z2m'.
-
- o 'z2m' must be a Zope 2 interface method.
- """
- if not isinstance(z2m, Z2_Method):
- raise ValueError, 'Not a Zope 2 interface method!'
-
- z3m = Z3_Method(z2m.getName(), z2m.getDoc())
- sig = z2m.getSignatureInfo()
- z3m.positional = sig['positional']
- z3m.required = sig['required']
- z3m.optional = sig['optional']
- z3m.varargs = sig['varargs']
- z3m.kwargs = sig['kwargs']
- return z3m
Modified: Zope/trunk/lib/python/Products/Five/doc/manual.txt
===================================================================
--- Zope/trunk/lib/python/Products/Five/doc/manual.txt 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Five/doc/manual.txt 2008-04-28 15:18:59 UTC (rev 85817)
@@ -131,6 +131,8 @@
``isImplementedBy`` has been deprecated (you'll see the
DeprecationWarnings in your Zope log).
+N.B.: As of Zope 2.12, the old Zope2 interfaces are *removed*.
+
Adapters
--------
Modified: Zope/trunk/lib/python/Products/Five/fiveconfigure.py
===================================================================
--- Zope/trunk/lib/python/Products/Five/fiveconfigure.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Five/fiveconfigure.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -37,7 +37,6 @@
from zope.security.interfaces import IPermission
from Products.Five import isFiveMethod
-from Products.Five.bridge import fromZ2Interface
from Products.Five.browser.metaconfigure import page
debug_mode = App.config.getConfiguration().debug_mode
@@ -105,29 +104,6 @@
interface)
)
-def createZope2Bridge(zope2, package, name):
- # Map a Zope 2 interface into a Zope3 interface, seated within 'package'
- # as 'name'.
- z3i = fromZ2Interface(zope2)
-
- if name is not None:
- z3i.__dict__['__name__'] = name
-
- z3i.__dict__['__module__'] = package.__name__
- setattr(package, z3i.getName(), z3i)
-
-def bridge(_context, zope2, package, name=None):
- # Directive handler for <five:bridge> directive.
-
- # N.B.: We have to do the work early, or else we won't be able
- # to use the synthesized interface in other ZCML directives.
- createZope2Bridge(zope2, package, name)
-
- # Faux action, only for conflict resolution.
- _context.action(
- discriminator = (zope2,),
- )
-
def pagesFromDirectory(_context, directory, module, for_=None,
layer=IDefaultBrowserLayer, permission='zope.Public'):
Modified: Zope/trunk/lib/python/Products/Five/meta.zcml
===================================================================
--- Zope/trunk/lib/python/Products/Five/meta.zcml 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Five/meta.zcml 2008-04-28 15:18:59 UTC (rev 85817)
@@ -95,12 +95,6 @@
/>
<meta:directive
- name="bridge"
- schema=".fivedirectives.IBridgeDirective"
- handler=".fiveconfigure.bridge"
- />
-
- <meta:directive
name="registerClass"
schema=".fivedirectives.IRegisterClassDirective"
handler=".fiveconfigure.registerClass"
Deleted: Zope/trunk/lib/python/Products/Five/tests/bridge.txt
===================================================================
--- Zope/trunk/lib/python/Products/Five/tests/bridge.txt 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Five/tests/bridge.txt 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,154 +0,0 @@
-======
-Bridge
-======
-
-The ``Five.bridge`` module provides functionality to convert a Zope 2
-interface into a Zope 3 one. First we'll import all we know about
-interfaces from the two generations:
-
- >>> from Interface import Interface as Z2_Interface
- >>> from Interface import Attribute as Z2_Attribute
-
- >>> from zope.interface import Interface as Z3_Interface
- >>> from zope.interface import Attribute as Z3_Attribute
- >>> from zope.interface.interface import Method as Z3_Method
-
-
-An empty interface
-------------------
-
- >>> class IEmpty(Z2_Interface):
- ... pass
-
- >>> from Products.Five.bridge import fromZ2Interface
- >>> IEmptyConverted = fromZ2Interface(IEmpty)
-
- >>> Z3_Interface.isEqualOrExtendedBy(IEmptyConverted)
- True
- >>> len(IEmptyConverted.names())
- 0
-
-
-Bases
------
-
- >>> class IBase(Z2_Interface):
- ... pass
- >>> class IDerived(IBase):
- ... pass
- >>> IBase.getBases() == (Z2_Interface,)
- True
- >>> IDerived.getBases() == (IBase,)
- True
- >>> IDerived.extends(IBase)
- 1
- >>> IDerived.extends(IEmpty)
- 0
-
- >>> IBaseConverted = fromZ2Interface(IBase)
- >>> IDerivedConverted = fromZ2Interface(IDerived)
- >>> IBaseConverted.getBases() == (Z3_Interface,)
- True
- >>> IDerivedConverted.getBases() == (IBaseConverted,)
- True
- >>> IDerivedConverted.extends(IBaseConverted)
- True
- >>> IDerivedConverted.extends(IEmptyConverted)
- False
-
-
-Attributes
-----------
-
- >>> class IAttributes(Z2_Interface):
- ... one = Z2_Attribute('one', 'One attribute')
- ... another = Z2_Attribute('another', 'Another attribute')
-
- >>> converted = fromZ2Interface(IAttributes)
-
- >>> Z3_Interface.isEqualOrExtendedBy(converted)
- True
- >>> len(converted.names())
- 2
- >>> 'one' in converted.names()
- True
- >>> 'another' in converted.names()
- True
-
- >>> one = converted.getDescriptionFor('one')
- >>> isinstance(one, Z3_Attribute)
- True
- >>> one.getName()
- 'one'
- >>> one.getDoc()
- 'One attribute'
-
- >>> another = converted.getDescriptionFor('another')
- >>> isinstance(another, Z3_Attribute)
- True
- >>> another.getName()
- 'another'
- >>> another.getDoc()
- 'Another attribute'
-
-
-Methods
--------
-
- >>> class IMethods(Z2_Interface):
- ... def one():
- ... """One method."""
- ... def another(arg1, arg2):
- ... """Another method, taking arguments."""
-
- >>> converted = fromZ2Interface(IMethods)
-
- >>> Z3_Interface.isEqualOrExtendedBy(converted)
- True
- >>> len(converted.names())
- 2
- >>> 'one' in converted.names()
- True
- >>> 'another' in converted.names()
- True
-
- >>> one = converted.getDescriptionFor('one')
- >>> isinstance(one, Z3_Method)
- True
- >>> one.getName()
- 'one'
- >>> one.getDoc()
- 'One method.'
- >>> one.getSignatureString()
- '()'
-
- >>> another = converted.getDescriptionFor('another')
- >>> isinstance(another, Z3_Method)
- True
- >>> another.getName()
- 'another'
- >>> another.getDoc()
- 'Another method, taking arguments.'
- >>> another.getSignatureString()
- '(arg1, arg2)'
-
-
-Invalid parameters
-------------------
-
- >>> fromZ2Interface(None)
- Traceback (most recent call last):
- ...
- ValueError: Not a Zope 2 interface!
-
- >>> fromZ2Interface(object())
- Traceback (most recent call last):
- ...
- ValueError: Not a Zope 2 interface!
-
- >>> class IZ3_NotAllowed(Z3_Interface):
- ... pass
- >>> fromZ2Interface(IZ3_NotAllowed)
- Traceback (most recent call last):
- ...
- ValueError: Not a Zope 2 interface!
Deleted: Zope/trunk/lib/python/Products/Five/tests/test_bridge.py
===================================================================
--- Zope/trunk/lib/python/Products/Five/tests/test_bridge.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Five/tests/test_bridge.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,27 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" Unit tests for Z2 -> Z3 bridge utilities.
-
-$Id$
-"""
-import os, sys
-if __name__ == '__main__':
- execfile(os.path.join(sys.path[0], 'framework.py'))
-
-def test_suite():
- from Testing.ZopeTestCase import ZopeDocFileSuite
- return ZopeDocFileSuite('bridge.txt', package="Products.Five.tests")
-
-if __name__ == '__main__':
- framework()
Modified: Zope/trunk/lib/python/Products/Five/viewlet/metaconfigure.py
===================================================================
--- Zope/trunk/lib/python/Products/Five/viewlet/metaconfigure.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Five/viewlet/metaconfigure.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -19,7 +19,9 @@
from zope.app.publisher.browser import viewmeta
from zope.component import zcml
from zope.configuration.exceptions import ConfigurationError
-from zope.interface import Interface, classImplements
+from zope.interface import classImplements
+from zope.interface import implements
+from zope.interface import Interface
from zope.publisher.interfaces.browser import IBrowserView
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
from zope.viewlet import interfaces
Modified: Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py
===================================================================
--- Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -34,7 +34,6 @@
from AccessControl.Permissions import view_management_screens
from webdav.Lockable import ResourceLockedError
-from webdav.WriteLockInterface import WriteLockInterface
from Products.PageTemplates.PageTemplate import PageTemplate
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
@@ -69,8 +68,6 @@
Traversable, PropertyManager):
"Zope wrapper for Page Template using TAL, TALES, and METAL"
- __implements__ = (WriteLockInterface,)
-
meta_type = 'Page Template'
output_encoding = 'iso-8859-15' # provide default for old instances
Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===================================================================
--- Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -204,6 +204,11 @@
class ZopePageTemplateFileTests(ZopeTestCase):
+ def test_class_conforms_to_IWriteLock(self):
+ from zope.interface.verify import verifyClass
+ from webdav.interfaces import IWriteLock
+ verifyClass(IWriteLock, ZopePageTemplate)
+
def testPT_RenderWithAscii(self):
manage_addPageTemplate(self.app, 'test',
text=ascii_str, encoding='ascii')
Modified: Zope/trunk/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -84,8 +84,6 @@
"""Index for dates.
"""
-
- __implements__ = UnIndex.__implements__
implements(IDateIndex)
meta_type = 'DateIndex'
Modified: Zope/trunk/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -56,8 +56,6 @@
- Objects which match only during a specific interval.
"""
-
- __implements__ = UnIndex.__implements__
implements(IDateRangeIndex)
security = ClassSecurityInfo()
Modified: Zope/trunk/lib/python/Products/PluginIndexes/FieldIndex/FieldIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/FieldIndex/FieldIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PluginIndexes/FieldIndex/FieldIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -24,9 +24,6 @@
"""Index for simple fields.
"""
-
- __implements__ = UnIndex.__implements__
-
meta_type="FieldIndex"
manage_options= (
Modified: Zope/trunk/lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -35,9 +35,6 @@
This should have an _apply_index that returns a relevance score
"""
-
- __implements__ = UnIndex.__implements__
-
meta_type="KeywordIndex"
manage_options= (
Modified: Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -25,7 +25,6 @@
from BTrees.Length import Length
from zope.interface import implements
-from Products.PluginIndexes import PluggableIndex
from Products.PluginIndexes.common import safe_callable
from Products.PluginIndexes.common.util import parseIndexRequest
from Products.PluginIndexes.interfaces import IPathIndex
@@ -50,8 +49,6 @@
- the value is a mapping 'level of the path component' to
'all docids with this path component on this level'
"""
-
- __implements__ = (PluggableIndex.UniqueValueIndex,)
implements(IPathIndex, IUniqueValueIndex)
meta_type="PathIndex"
Modified: Zope/trunk/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -30,7 +30,6 @@
from BTrees.OIBTree import OIBTree
from zope.interface import implements
-from Products.PluginIndexes import PluggableIndex
from Products.PluginIndexes.common import safe_callable
from Products.PluginIndexes.common.ResultList import ResultList
from Products.PluginIndexes.common.util import parseIndexRequest
@@ -77,8 +76,6 @@
This isn't exactly how things are represented in memory, many
optimizations happen along the way.
"""
-
- __implements__ = (PluggableIndex.PluggableIndexInterface,)
implements(ITextIndex, IPluggableIndex)
meta_type='TextIndex'
Modified: Zope/trunk/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -23,7 +23,6 @@
from BTrees.IIBTree import IITreeSet,intersection,union
from zope.interface import implements
-from Products.PluginIndexes import PluggableIndex
from Products.PluginIndexes.common.util import parseIndexRequest
from Products.PluginIndexes.interfaces import IPluggableIndex
from Products.PluginIndexes.interfaces import ITopicIndex
@@ -41,8 +40,6 @@
Every FilteredSet object consists of an expression and and IISet with all
Ids of indexed objects that eval with this expression to 1.
"""
-
- __implements__ = (PluggableIndex.PluggableIndexInterface,)
implements(ITopicIndex, IPluggableIndex)
meta_type="TopicIndex"
Modified: Zope/trunk/lib/python/Products/PluginIndexes/__init__.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/__init__.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PluginIndexes/__init__.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -11,7 +11,6 @@
#
##############################################################################
-import common.PluggableIndex as PluggableIndex
import common.ResultList as ResultList
import common.UnIndex as UnIndex
Deleted: Zope/trunk/lib/python/Products/PluginIndexes/common/PluggableIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/common/PluggableIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PluginIndexes/common/PluggableIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,34 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Pluggable Index interfaces.
-
-$Id$
-"""
-
-
-# create PluggableIndexInterface, UniqueValueIndex, SortIndex
-from Interface.bridge import createZope3Bridge
-from Products.PluginIndexes.interfaces import IPluggableIndex
-from Products.PluginIndexes.interfaces import ISortIndex
-from Products.PluginIndexes.interfaces import IUniqueValueIndex
-import PluggableIndex
-
-createZope3Bridge(IPluggableIndex, PluggableIndex, 'PluggableIndexInterface')
-createZope3Bridge(ISortIndex, PluggableIndex, 'SortIndex')
-createZope3Bridge(IUniqueValueIndex, PluggableIndex, 'UniqueValueIndex')
-
-del createZope3Bridge
-del IPluggableIndex
-del ISortIndex
-del IUniqueValueIndex
-del PluggableIndex
Modified: Zope/trunk/lib/python/Products/PluginIndexes/common/UnIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/common/UnIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PluginIndexes/common/UnIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -27,7 +27,6 @@
from ZODB.POSException import ConflictError
from zope.interface import implements
-from Products.PluginIndexes import PluggableIndex
from Products.PluginIndexes.common import safe_callable
from Products.PluginIndexes.common.util import parseIndexRequest
from Products.PluginIndexes.interfaces import IPluggableIndex
@@ -42,9 +41,6 @@
"""Simple forward and reverse index.
"""
-
- __implements__ = (PluggableIndex.UniqueValueIndex,
- PluggableIndex.SortIndex)
implements(IPluggableIndex, IUniqueValueIndex, ISortIndex)
def __init__(
Modified: Zope/trunk/lib/python/Products/PythonScripts/PythonScript.py
===================================================================
--- Zope/trunk/lib/python/Products/PythonScripts/PythonScript.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PythonScripts/PythonScript.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -28,7 +28,6 @@
from DateTime.DateTime import DateTime
from urllib import quote
from webdav.Lockable import ResourceLockedError
-from webdav.WriteLockInterface import WriteLockInterface
from Shared.DC.Scripts.Script import Script, BindingsUI, defaultBindings
from AccessControl import getSecurityManager
from OFS.History import Historical, html_diff
@@ -86,7 +85,6 @@
not attempt to use the "exec" statement or certain restricted builtins.
"""
- __implements__ = (WriteLockInterface,)
meta_type='Script (Python)'
_proxy_roles = ()
Modified: Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py
===================================================================
--- Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -296,11 +296,19 @@
self.assertEqual(f(), [0])
self._free_warning_output()
+class PythonScriptInterfaceConformanceTests(unittest.TestCase):
+
+ def test_class_conforms_to_IWriteLock(self):
+ from zope.interface.verify import verifyClass
+ from webdav.interfaces import IWriteLock
+ verifyClass(IWriteLock, PythonScript)
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestPythonScriptNoAq))
suite.addTest(unittest.makeSuite(TestPythonScriptErrors))
suite.addTest(unittest.makeSuite(TestPythonScriptGlobals))
+ suite.addTest(unittest.makeSuite(PythonScriptInterfaceConformanceTests))
return suite
Modified: Zope/trunk/lib/python/Products/Sessions/BrowserIdManager.py
===================================================================
--- Zope/trunk/lib/python/Products/Sessions/BrowserIdManager.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Sessions/BrowserIdManager.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -32,6 +32,7 @@
from ZPublisher.BeforeTraverse import registerBeforeTraverse, \
unregisterBeforeTraverse, queryBeforeTraverse
import logging
+from zope.interface import implements
b64_trans = string.maketrans('+/', '-.')
b64_untrans = string.maketrans('-.', '+/')
@@ -80,7 +81,7 @@
{'label': 'Ownership', 'action':'manage_owner'}
)
- __implements__ = (SessionInterfaces.BrowserIdManagerInterface, )
+ implements(SessionInterfaces.BrowserIdManagerInterface)
icon = 'misc_/Sessions/idmgr.gif'
Modified: Zope/trunk/lib/python/Products/Sessions/SessionDataManager.py
===================================================================
--- Zope/trunk/lib/python/Products/Sessions/SessionDataManager.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Sessions/SessionDataManager.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -29,6 +29,7 @@
BROWSERID_MANAGER_NAME
from ZPublisher.BeforeTraverse import registerBeforeTraverse, \
unregisterBeforeTraverse
+from zope.interface import implements
bad_path_chars_in=re.compile('[^a-zA-Z0-9-_~\,\. \/]').search
LOG = getLogger('SessionDataManager')
@@ -80,7 +81,7 @@
icon='misc_/CoreSessionTracking/datamgr.gif'
- __implements__ = (SessionInterfaces.SessionDataManagerInterface, )
+ implements(SessionInterfaces.SessionDataManagerInterface)
manage_sessiondatamgr = Globals.DTMLFile('dtml/manageDataManager',
globals())
Modified: Zope/trunk/lib/python/Products/Sessions/SessionInterfaces.py
===================================================================
--- Zope/trunk/lib/python/Products/Sessions/SessionInterfaces.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Sessions/SessionInterfaces.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -20,11 +20,9 @@
"""
-import Interface
+from zope.interface import Interface
-class BrowserIdManagerInterface(
- Interface.Base
- ):
+class BrowserIdManagerInterface(Interface):
"""
Zope Browser Id Manager interface.
@@ -152,9 +150,7 @@
name and current browser id.
"""
-class SessionDataManagerInterface(
- Interface.Base
- ):
+class SessionDataManagerInterface(Interface):
"""
Zope Session Data Manager interface.
@@ -199,7 +195,7 @@
Permission required: Access arbitrary user session data
"""
-class SessionDataManagerErr(Interface.Base):
+class SessionDataManagerErr(Interface):
"""
Error raised during some session data manager operations, as
explained in the API documentation of the Session Data Manager.
@@ -210,7 +206,7 @@
from Products.Sessions import SessionDataManagerErr
"""
-class BrowserIdManagerErr(Interface.Base):
+class BrowserIdManagerErr(Interface):
"""
Error raised during some browser id manager operations, as
explained in the API documentation of the Browser Id Manager.
Deleted: Zope/trunk/lib/python/Products/Sessions/help/SessionInterfaces.py
===================================================================
--- Zope/trunk/lib/python/Products/Sessions/help/SessionInterfaces.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Sessions/help/SessionInterfaces.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,222 +0,0 @@
-############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-############################################################################
-"""
-
-Session APIs
-
- See Also
-
- - "Transient Object API":../../Transience/Help/TransienceInterfaces.py
-
-"""
-
-import Interface
-
-class BrowserIdManagerInterface(
- Interface.Base
- ):
- """
- Zope Browser Id Manager interface.
-
- A Zope Browser Id Manager is responsible for assigning ids to site
- visitors, and for servicing requests from Session Data Managers
- related to the browser id.
- """
- def encodeUrl(url, style='querystring'):
- """
- Encodes a provided URL with the current request's browser id
- and returns the result. Two forms of URL-encoding are supported:
- 'querystring' and 'inline'. 'querystring' is the default.
-
- If the 'querystring' form is used, the browser id name/value pair
- are postfixed onto the URL as a query string. If the 'inline'
- form is used, the browser id name/value pair are prefixed onto
- the URL as the first two path segment elements.
-
- For example:
-
- The call encodeUrl('http://foo.com/amethod', style='querystring')
- might return 'http://foo.com/amethod?_ZopeId=as9dfu0adfu0ad'.
-
- The call encodeUrl('http://foo.com/amethod, style='inline')
- might return 'http://foo.com/_ZopeId/as9dfu0adfu0ad/amethod'.
-
- Permission required: Access contents information
-
- Raises: BrowserIdManagerErr. If there is no current browser id.
- """
-
- def getBrowserIdName():
- """
- Returns a string with the name of the cookie/form variable which is
- used by the current browser id manager as the name to look up when
- attempting to obtain the browser id value. For example, '_ZopeId'.
-
- Permission required: Access contents information
- """
-
- def getBrowserId(create=1):
- """
- If create=0, returns a the current browser id or None if there
- is no browser id associated with the current request. If create=1,
- returns the current browser id or a newly-created browser id if
- there is no browser id associated with the current request. This
- method is useful in conjunction with getBrowserIdName if you wish to
- embed the browser-id-name/browser-id combination as a hidden value in
- a POST-based form. The browser id is opaque, has no business meaning,
- and its length, type, and composition are subject to change.
-
- Permission required: Access contents information
-
- Raises: BrowserIdManagerErr. If ill-formed browser id
- is found in REQUEST.
- """
-
- def hasBrowserId():
- """
- Returns true if there is a browser id for this request.
-
- Permission required: Access contents information
- """
-
- def isBrowserIdNew():
- """
- Returns true if browser id is 'new'. A browser id is 'new'
- when it is first created and the client has therefore not sent it
- back to the server in any request.
-
- Permission required: Access contents information
-
- Raises: BrowserIdManagerErr. If there is no current browser id.
- """
-
- def isBrowserIdFromForm():
- """
- Returns true if browser id comes from a form variable (query
- string or post).
-
- Permission required: Access contents information
-
- Raises: BrowserIdManagerErr. If there is no current browser id.
- """
-
- def isBrowserIdFromCookie():
- """
- Returns true if browser id comes from a cookie.
-
- Permission required: Access contents information
-
- Raises: BrowserIdManagerErr. If there is no current browser id.
- """
-
- def flushBrowserIdCookie():
- """
- Deletes the browser id cookie from the client browser, iff the
- 'cookies' browser id namespace is being used.
-
- Permission required: Access contents information
-
- Raises: BrowserIdManagerErr. If the 'cookies' namespace isn't
- a browser id namespace at the time of the call.
- """
-
- def setBrowserIdCookieByForce(bid):
- """
- Sets the browser id cookie to browser id 'bid' by force.
- Useful when you need to 'chain' browser id cookies across domains
- for the same user (perhaps temporarily using query strings).
-
- Permission required: Access contents information
-
- Raises: BrowserIdManagerErr. If the 'cookies' namespace isn't
- a browser id namespace at the time of the call.
- """
-
- def getHiddenFormField():
- """
- Returns a string in the form:
-
- <input type="hidden" name="_ZopeId" value="H7HJGYUFGFyHKH*">
-
- Where the name and the value represent the current browser id
- name and current browser id.
- """
-
-class SessionDataManagerInterface(
- Interface.Base
- ):
- """
- Zope Session Data Manager interface.
-
- A Zope Session Data Manager is responsible for maintaining Session
- Data Objects, and for servicing requests from application code
- related to Session Data Objects. It also communicates with a Browser
- Id Manager to provide information about browser ids.
- """
- def getBrowserIdManager():
- """
- Returns the nearest acquirable browser id manager.
-
- Raises SessionDataManagerErr if no browser id manager can be found.
-
- Permission required: Access session data
- """
-
- def getSessionData(create=1):
- """
- Returns a Session Data Object associated with the current
- browser id. If there is no current browser id, and create is true,
- returns a new Session Data Object. If there is no current
- browser id and create is false, returns None.
-
- Permission required: Access session data
- """
-
- def hasSessionData():
- """
- Returns true if a Session Data Object associated with the
- current browser id is found in the Session Data Container. Does
- not create a Session Data Object if one does not exist.
-
- Permission required: Access session data
- """
-
- def getSessionDataByKey(key):
- """
- Returns a Session Data Object associated with 'key'. If there is
- no Session Data Object associated with 'key' return None.
-
- Permission required: Access arbitrary user session data
- """
-
-class SessionDataManagerErr(Interface.Base):
- """
- Error raised during some session data manager operations, as
- explained in the API documentation of the Session Data Manager.
-
- This exception may be caught in PythonScripts. A successful
- import of the exception for PythonScript use would need to be::
-
- from Products.Sessions import SessionDataManagerErr
- """
-
-class BrowserIdManagerErr(Interface.Base):
- """
- Error raised during some browser id manager operations, as
- explained in the API documentation of the Browser Id Manager.
-
- This exception may be caught in PythonScripts. A successful
- import of the exception for PythonScript use would need to be::
-
- from Products.Sessions import BrowserIdManagerErr
- """
Modified: Zope/trunk/lib/python/Products/Transience/Transience.py
===================================================================
--- Zope/trunk/lib/python/Products/Transience/Transience.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Transience/Transience.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -42,6 +42,8 @@
from AccessControl.User import nobody
from logging import getLogger
+from zope.interface import implements
+
from TransientObject import TransientObject
from Fake import FakeIOBTree
@@ -97,10 +99,10 @@
meta_type = "Transient Object Container"
icon = "misc_/Transience/datacontainer.gif"
- __implements__ = (ItemWithId,
- StringKeyedHomogeneousItemContainer,
- TransientItemContainer
- )
+ implements(ItemWithId,
+ StringKeyedHomogeneousItemContainer,
+ TransientItemContainer,
+ )
manage_options = (
{ 'label': 'Manage',
'action': 'manage_container',
Modified: Zope/trunk/lib/python/Products/Transience/TransienceInterfaces.py
===================================================================
--- Zope/trunk/lib/python/Products/Transience/TransienceInterfaces.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Transience/TransienceInterfaces.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -74,9 +74,9 @@
transient_object['foo'] = foo
"""
-import Interface
+from zope.interface import Interface
-class Transient(Interface.Base):
+class Transient(Interface):
def invalidate():
"""
Invalidate (expire) the transient object.
@@ -131,7 +131,7 @@
container.
"""
-class DictionaryLike(Interface.Base):
+class DictionaryLike(Interface):
def keys():
"""
Return sequence of key elements.
@@ -170,7 +170,7 @@
# DictionaryLike does NOT support copy()
-class ItemWithId(Interface.Base):
+class ItemWithId(Interface):
def getId():
"""
Returns a meaningful unique id for the object. Note that this id
@@ -193,7 +193,7 @@
Call __setitem__ with key k, value v.
"""
-class ImmutablyValuedMappingOfPickleableObjects(Interface.Base):
+class ImmutablyValuedMappingOfPickleableObjects(Interface):
def __setitem__(k, v):
"""
Sets key k to value v, if k is both hashable and pickleable and
@@ -216,7 +216,7 @@
Remove the key/value pair related to key k.
"""
-class HomogeneousItemContainer(Interface.Base):
+class HomogeneousItemContainer(Interface):
"""
An object which:
1. Contains zero or more subobjects, all of the same type.
@@ -271,7 +271,7 @@
Returned object is acquisition-wrapped in self.
"""
-class TransientItemContainer(Interface.Base):
+class TransientItemContainer(Interface):
def setTimeoutMinutes(timeout_mins):
"""
Set the number of minutes of inactivity allowable for subobjects
Modified: Zope/trunk/lib/python/Products/Transience/TransientObject.py
===================================================================
--- Zope/trunk/lib/python/Products/Transience/TransientObject.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/Transience/TransientObject.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -30,6 +30,7 @@
import logging
import sys
from ZODB.POSException import ConflictError
+from zope.interface import implements
DEBUG = int(os.environ.get('Z_TOC_DEBUG', 0))
LOG = logging.getLogger('Zope.TransientObject')
@@ -51,12 +52,12 @@
""" Dictionary-like object that supports additional methods
concerning expiration and containment in a transient object container
"""
- __implements__ = (ItemWithId, # randomly generate an id
- Transient,
- DictionaryLike,
- TTWDictionary,
- ImmutablyValuedMappingOfPickleableObjects
- )
+ implements(ItemWithId, # randomly generate an id
+ Transient,
+ DictionaryLike,
+ TTWDictionary,
+ ImmutablyValuedMappingOfPickleableObjects
+ )
security = ClassSecurityInfo()
security.setDefaultAccess('allow')
@@ -97,7 +98,7 @@
# search our acquisition chain for a transient object container
# and delete ourselves from it.
for ob in getattr(self, 'aq_chain', []):
- if TransientItemContainer.isImplementedBy(ob):
+ if TransientItemContainer.providedBy(ob):
trans_ob_container = ob
break
if trans_ob_container is not None:
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/BaseIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/BaseIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/BaseIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -29,6 +29,7 @@
import ZODB
from Persistence import Persistent
+from zope.interface import implements
# Instead of storing floats, we generally store scaled ints. Binary pickles
# can store those more efficiently. The default SCALE_FACTOR of 1024
@@ -52,7 +53,7 @@
class BaseIndex(Persistent):
- __implements__ = IIndex
+ implements(IIndex)
def __init__(self, lexicon):
self._lexicon = lexicon
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/CosineIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/CosineIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/CosineIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -17,6 +17,7 @@
import math
from BTrees.IIBTree import IIBucket
+from zope.interface import implements
from Products.ZCTextIndex.IIndex import IIndex
from Products.ZCTextIndex.BaseIndex import BaseIndex, \
@@ -25,7 +26,7 @@
class CosineIndex(BaseIndex):
- __implements__ = IIndex
+ implements(IIndex)
def __init__(self, lexicon):
BaseIndex.__init__(self, lexicon)
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/HTMLSplitter.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/HTMLSplitter.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/HTMLSplitter.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -14,12 +14,13 @@
from Products.ZCTextIndex.ISplitter import ISplitter
from Products.ZCTextIndex.PipelineFactory import element_factory
+from zope.interface import implements
import re
class HTMLWordSplitter:
- __implements__ = ISplitter
+ implements(ISplitter)
def process(self, text, wordpat=r"(?L)\w+"):
splat = []
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/IIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/IIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/IIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -14,9 +14,9 @@
"""Index Interface."""
-import Interface
+from zope.interface import Interface
-class IIndex(Interface.Base):
+class IIndex(Interface):
"""Interface for an Index."""
def length():
Deleted: Zope/trunk/lib/python/Products/ZCTextIndex/ILexicon.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/ILexicon.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/ILexicon.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,28 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Lexicon z2 interfaces.
-
-$Id$
-"""
-
-
-# create ILexicon
-from Interface.bridge import createZope3Bridge
-from interfaces import ILexicon as z3ILexicon
-import ILexicon
-
-createZope3Bridge(z3ILexicon, ILexicon, 'ILexicon')
-
-del createZope3Bridge
-del z3ILexicon
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/INBest.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/INBest.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/INBest.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -20,9 +20,9 @@
"""
-import Interface
+from zope.interface import Interface
-class INBest(Interface.Base):
+class INBest(Interface):
"""Interface for an N-Best chooser."""
def add(item, score):
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/IPipelineElement.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/IPipelineElement.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/IPipelineElement.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -12,7 +12,7 @@
#
##############################################################################
-from Interface import Interface
+from zope.interface import Interface
class IPipelineElement(Interface):
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/IPipelineElementFactory.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/IPipelineElementFactory.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/IPipelineElementFactory.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -12,7 +12,7 @@
#
##############################################################################
-from Interface import Interface
+from zope.interface import Interface
class IPipelineElementFactory(Interface):
"""Class for creating pipeline elements by name"""
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/IQueryParseTree.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/IQueryParseTree.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/IQueryParseTree.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -14,9 +14,9 @@
"""Query Parser Tree Interface."""
-import Interface
+from zope.interface import Interface
-class IQueryParseTree(Interface.Base):
+class IQueryParseTree(Interface):
"""Interface for parse trees returned by parseQuery()."""
def nodeType():
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/IQueryParser.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/IQueryParser.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/IQueryParser.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -14,9 +14,9 @@
"""Query Parser Interface."""
-import Interface
+from zope.interface import Interface
-class IQueryParser(Interface.Base):
+class IQueryParser(Interface):
"""Interface for Query Parsers."""
def parseQuery(query):
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/ISplitter.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/ISplitter.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/ISplitter.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -12,7 +12,7 @@
#
##############################################################################
-from Interface import Interface
+from zope.interface import Interface
class ISplitter(Interface):
"""A splitter."""
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/Lexicon.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/Lexicon.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/Lexicon.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -29,13 +29,11 @@
from Products.ZCTextIndex.StopDict import get_stopdict
from Products.ZCTextIndex.ParseTree import QueryError
from Products.ZCTextIndex.PipelineFactory import element_factory
-from ILexicon import ILexicon as z2ILexicon
from interfaces import ILexicon
class Lexicon(Persistent):
- __implements__ = z2ILexicon
implements(ILexicon)
def __init__(self, *pipeline):
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/NBest.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/NBest.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/NBest.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -19,11 +19,12 @@
"""
from bisect import bisect
+from zope.interface import implements
from Products.ZCTextIndex.INBest import INBest
class NBest:
- __implements__ = INBest
+ implements(INBest)
def __init__(self, N):
"Build an NBest object to remember the N best-scoring objects."
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/OkapiIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/OkapiIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/OkapiIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -19,6 +19,7 @@
from BTrees.IIBTree import IIBucket
from BTrees.Length import Length
+from zope.interface import implements
from Products.ZCTextIndex.IIndex import IIndex
from Products.ZCTextIndex.BaseIndex import BaseIndex, \
@@ -28,7 +29,7 @@
class OkapiIndex(BaseIndex):
- __implements__ = IIndex
+ implements(IIndex)
# BM25 free parameters.
K1 = 1.2
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/ParseTree.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/ParseTree.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/ParseTree.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -13,6 +13,7 @@
##############################################################################
"""Generic parser support: exception and parse tree nodes."""
+from zope.interface import implements
from BTrees.IIBTree import difference
@@ -28,7 +29,7 @@
class ParseTreeNode:
- __implements__ = IQueryParseTree
+ implements(IQueryParseTree)
_nodeType = None
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/PipelineFactory.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/PipelineFactory.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/PipelineFactory.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -11,13 +11,14 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
+from zope.interface import implements
from Products.ZCTextIndex.IPipelineElementFactory \
import IPipelineElementFactory
class PipelineElementFactory:
- __implements__ = IPipelineElementFactory
+ implements(IPipelineElementFactory)
def __init__(self):
self._groups = {}
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/QueryParser.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/QueryParser.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/QueryParser.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -56,6 +56,7 @@
"""
import re
+from zope.interface import implements
from Products.ZCTextIndex.IQueryParser import IQueryParser
from Products.ZCTextIndex import ParseTree
@@ -95,7 +96,7 @@
class QueryParser:
- __implements__ = IQueryParser
+ implements(IQueryParser)
# This class is not thread-safe;
# each thread should have its own instance
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/ZCTextIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/ZCTextIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/ZCTextIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -27,8 +27,6 @@
from AccessControl.Permissions import manage_zcatalog_indexes, search_zcatalog
from zope.interface import implements
-from Products.PluginIndexes.common.PluggableIndex import \
- PluggableIndexInterface
from Products.PluginIndexes.common.util import parseIndexRequest
from Products.PluginIndexes.common import safe_callable
from Products.PluginIndexes.interfaces import IPluggableIndex
@@ -38,7 +36,6 @@
from Products.ZCTextIndex.NBest import NBest
from Products.ZCTextIndex.QueryParser import QueryParser
from CosineIndex import CosineIndex
-from ILexicon import ILexicon as z2ILexicon
from interfaces import ILexicon
from interfaces import IZCLexicon
from interfaces import IZCTextIndex
@@ -54,8 +51,6 @@
"""Persistent text index.
"""
-
- __implements__ = PluggableIndexInterface
implements(IZCTextIndex, IPluggableIndex)
## Magic class attributes ##
@@ -89,8 +84,7 @@
if lexicon is None:
raise LookupError, 'Lexicon "%s" not found' % escape(lexicon_id)
- if not (ILexicon.providedBy(lexicon) or
- z2ILexicon.isImplementedBy(lexicon)):
+ if not ILexicon.providedBy(lexicon):
raise ValueError('Object "%s" does not implement '
'ZCTextIndex Lexicon interface'
% lexicon.getId())
@@ -135,8 +129,7 @@
return self._v_lexicon
except AttributeError:
lexicon = getattr(aq_parent(aq_inner(self)), self.lexicon_id)
- if not (ILexicon.providedBy(lexicon) or
- z2ILexicon.isImplementedBy(lexicon)):
+ if not ILexicon.providedBy(lexicon):
raise TypeError('Object "%s" is not a ZCTextIndex Lexicon'
% repr(lexicon))
self._v_lexicon = lexicon
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/tests/testLexicon.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/tests/testLexicon.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/tests/testLexicon.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -71,12 +71,6 @@
class Test(unittest.TestCase):
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
- from Products.ZCTextIndex.ILexicon import ILexicon
-
- verifyClass(ILexicon, Lexicon)
-
def test_z3interfaces(self):
from Products.ZCTextIndex.interfaces import ILexicon
from zope.interface.verify import verifyClass
Copied: Zope/trunk/lib/python/Products/ZCTextIndex/tests/testParseTree.py (from rev 85794, Zope/branches/tseaver-2.11-no-z2-interfaces/lib/python/Products/ZCTextIndex/tests/testParseTree.py)
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/tests/testParseTree.py (rev 0)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/tests/testParseTree.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -0,0 +1,59 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import unittest
+
+class ParseTreeTests(unittest.TestCase):
+
+ def _conforms(self, klass):
+ from zope.interface.verify import verifyClass
+ from Products.ZCTextIndex.IQueryParseTree import IQueryParseTree
+ verifyClass(IQueryParseTree, klass)
+
+ def test_ParseTreeNode_conforms_to_IQueryParseTree(self):
+ from Products.ZCTextIndex.ParseTree import ParseTreeNode
+ self._conforms(ParseTreeNode)
+
+ def test_OrNode_conforms_to_IQueryParseTree(self):
+ from Products.ZCTextIndex.ParseTree import OrNode
+ self._conforms(OrNode)
+
+ def test_AndNode_conforms_to_IQueryParseTree(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ self._conforms(AndNode)
+
+ def test_NotNode_conforms_to_IQueryParseTree(self):
+ from Products.ZCTextIndex.ParseTree import NotNode
+ self._conforms(NotNode)
+
+ def test_GlobNode_conforms_to_IQueryParseTree(self):
+ from Products.ZCTextIndex.ParseTree import GlobNode
+ self._conforms(GlobNode)
+
+ def test_AtomNode_conforms_to_IQueryParseTree(self):
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ self._conforms(AtomNode)
+
+ def test_PhraseNode_conforms_to_IQueryParseTree(self):
+ from Products.ZCTextIndex.ParseTree import PhraseNode
+ self._conforms(PhraseNode)
+
+
+def test_suite():
+ return unittest.TestSuite((
+ unittest.makeSuite(ParseTreeTests),
+ ))
+
+if __name__=="__main__":
+ unittest.main(defaultTest='test_suite')
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/tests/testPipelineFactory.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/tests/testPipelineFactory.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/tests/testPipelineFactory.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -15,10 +15,11 @@
from unittest import TestCase, TestSuite, main, makeSuite
from Products.ZCTextIndex.IPipelineElement import IPipelineElement
from Products.ZCTextIndex.PipelineFactory import PipelineElementFactory
+from zope.interface import implements
class NullPipelineElement:
- __implements__ = IPipelineElement
+ implements(IPipelineElement)
def process(source):
pass
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/tests/testQueryParser.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/tests/testQueryParser.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/tests/testQueryParser.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -14,34 +14,21 @@
from unittest import TestCase, TestSuite, main, makeSuite
-from Interface.Verify import verifyClass
-
-from Products.ZCTextIndex.IQueryParser import IQueryParser
-from Products.ZCTextIndex.IQueryParseTree import IQueryParseTree
-
-from Products.ZCTextIndex.QueryParser import QueryParser
-from Products.ZCTextIndex.ParseTree import ParseError, ParseTreeNode
-from Products.ZCTextIndex.ParseTree import OrNode, AndNode, NotNode
-from Products.ZCTextIndex.ParseTree import AtomNode, PhraseNode, GlobNode
-from Products.ZCTextIndex.Lexicon import Lexicon, Splitter
-
-
class TestInterfaces(TestCase):
def testInterfaces(self):
+ from zope.interface.verify import verifyClass
+ from Products.ZCTextIndex.IQueryParser import IQueryParser
+ from Products.ZCTextIndex.QueryParser import QueryParser
verifyClass(IQueryParser, QueryParser)
- verifyClass(IQueryParseTree, ParseTreeNode)
- verifyClass(IQueryParseTree, OrNode)
- verifyClass(IQueryParseTree, AndNode)
- verifyClass(IQueryParseTree, NotNode)
- verifyClass(IQueryParseTree, AtomNode)
- verifyClass(IQueryParseTree, PhraseNode)
- verifyClass(IQueryParseTree, GlobNode)
class TestQueryParserBase(TestCase):
def setUp(self):
+ from Products.ZCTextIndex.QueryParser import QueryParser
+ from Products.ZCTextIndex.Lexicon import Lexicon
+ from Products.ZCTextIndex.Lexicon import Splitter
self.lexicon = Lexicon(Splitter())
self.parser = QueryParser(self.lexicon)
@@ -56,10 +43,18 @@
self.assertEqual(ex_ignored, expected_ignored)
def failure(self, input):
+ from Products.ZCTextIndex.ParseTree import ParseError
self.assertRaises(ParseError, self.parser.parseQuery, input)
self.assertRaises(ParseError, self.parser.parseQueryEx, input)
def compareParseTrees(self, got, expected, msg=None):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ from Products.ZCTextIndex.ParseTree import GlobNode
+ from Products.ZCTextIndex.ParseTree import NotNode
+ from Products.ZCTextIndex.ParseTree import OrNode
+ from Products.ZCTextIndex.ParseTree import ParseTreeNode
+ from Products.ZCTextIndex.ParseTree import PhraseNode
if msg is None:
msg = repr(got)
self.assertEqual(isinstance(got, ParseTreeNode), 1)
@@ -89,83 +84,129 @@
class TestQueryParser(TestQueryParserBase):
def test001(self):
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect("foo", AtomNode("foo"))
def test002(self):
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect("note", AtomNode("note"))
def test003(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect("aa and bb AND cc",
AndNode([AtomNode("aa"), AtomNode("bb"), AtomNode("cc")]))
def test004(self):
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ from Products.ZCTextIndex.ParseTree import OrNode
self.expect("aa OR bb or cc",
OrNode([AtomNode("aa"), AtomNode("bb"), AtomNode("cc")]))
def test005(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ from Products.ZCTextIndex.ParseTree import OrNode
self.expect("aa AND bb OR cc AnD dd",
OrNode([AndNode([AtomNode("aa"), AtomNode("bb")]),
AndNode([AtomNode("cc"), AtomNode("dd")])]))
def test006(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ from Products.ZCTextIndex.ParseTree import OrNode
self.expect("(aa OR bb) AND (cc OR dd)",
AndNode([OrNode([AtomNode("aa"), AtomNode("bb")]),
OrNode([AtomNode("cc"), AtomNode("dd")])]))
def test007(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ from Products.ZCTextIndex.ParseTree import NotNode
self.expect("aa AND NOT bb",
AndNode([AtomNode("aa"), NotNode(AtomNode("bb"))]))
def test010(self):
+ from Products.ZCTextIndex.ParseTree import PhraseNode
self.expect('"foo bar"', PhraseNode(["foo", "bar"]))
def test011(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect("foo bar", AndNode([AtomNode("foo"), AtomNode("bar")]))
def test012(self):
+ from Products.ZCTextIndex.ParseTree import PhraseNode
self.expect('(("foo bar"))"', PhraseNode(["foo", "bar"]))
def test013(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect("((foo bar))", AndNode([AtomNode("foo"), AtomNode("bar")]))
def test014(self):
+ from Products.ZCTextIndex.ParseTree import PhraseNode
self.expect("foo-bar", PhraseNode(["foo", "bar"]))
def test015(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ from Products.ZCTextIndex.ParseTree import NotNode
self.expect("foo -bar", AndNode([AtomNode("foo"),
NotNode(AtomNode("bar"))]))
def test016(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ from Products.ZCTextIndex.ParseTree import NotNode
self.expect("-foo bar", AndNode([AtomNode("bar"),
NotNode(AtomNode("foo"))]))
def test017(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ from Products.ZCTextIndex.ParseTree import NotNode
+ from Products.ZCTextIndex.ParseTree import PhraseNode
self.expect("booh -foo-bar",
AndNode([AtomNode("booh"),
NotNode(PhraseNode(["foo", "bar"]))]))
def test018(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ from Products.ZCTextIndex.ParseTree import NotNode
+ from Products.ZCTextIndex.ParseTree import PhraseNode
self.expect('booh -"foo bar"',
AndNode([AtomNode("booh"),
NotNode(PhraseNode(["foo", "bar"]))]))
def test019(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect('foo"bar"',
AndNode([AtomNode("foo"), AtomNode("bar")]))
def test020(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect('"foo"bar',
AndNode([AtomNode("foo"), AtomNode("bar")]))
def test021(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect('foo"bar"blech',
AndNode([AtomNode("foo"), AtomNode("bar"),
AtomNode("blech")]))
def test022(self):
+ from Products.ZCTextIndex.ParseTree import GlobNode
self.expect("foo*", GlobNode("foo*"))
def test023(self):
+ from Products.ZCTextIndex.ParseTree import AndNode
+ from Products.ZCTextIndex.ParseTree import AtomNode
+ from Products.ZCTextIndex.ParseTree import GlobNode
self.expect("foo* bar", AndNode([GlobNode("foo*"),
AtomNode("bar")]))
@@ -239,26 +280,35 @@
class StopWordTestQueryParser(TestQueryParserBase):
def setUp(self):
+ from Products.ZCTextIndex.QueryParser import QueryParser
+ from Products.ZCTextIndex.Lexicon import Lexicon
+ from Products.ZCTextIndex.Lexicon import Splitter
# Only 'stop' is a stopword (but 'and' is still an operator)
self.lexicon = Lexicon(Splitter(), FakeStopWordRemover())
self.parser = QueryParser(self.lexicon)
def test201(self):
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect('and/', AtomNode("and"))
def test202(self):
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect('foo AND stop', AtomNode("foo"), ["stop"])
def test203(self):
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect('foo AND NOT stop', AtomNode("foo"), ["stop"])
def test204(self):
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect('stop AND foo', AtomNode("foo"), ["stop"])
def test205(self):
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect('foo OR stop', AtomNode("foo"), ["stop"])
def test206(self):
+ from Products.ZCTextIndex.ParseTree import AtomNode
self.expect('stop OR foo', AtomNode("foo"), ["stop"])
def test301(self):
Modified: Zope/trunk/lib/python/Products/ZCTextIndex/tests/testZCTextIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCTextIndex/tests/testZCTextIndex.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCTextIndex/tests/testZCTextIndex.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -252,13 +252,6 @@
# Gigabytes, pp. 180-188. This test peeks into many internals of the
# cosine indexer.
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
- from Products.PluginIndexes.common.PluggableIndex \
- import PluggableIndexInterface
-
- verifyClass(PluggableIndexInterface, ZCTextIndex)
-
def test_z3interfaces(self):
from Products.PluginIndexes.interfaces import IPluggableIndex
from Products.ZCTextIndex.interfaces import IZCTextIndex
Deleted: Zope/trunk/lib/python/Products/ZCatalog/IZCatalog.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCatalog/IZCatalog.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCatalog/IZCatalog.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,26 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-$Id$
-"""
-
-
-# create IZCatalog
-from Interface.bridge import createZope3Bridge
-from interfaces import IZCatalog as z3IZCatalog
-import IZCatalog
-
-createZope3Bridge(z3IZCatalog, IZCatalog, 'IZCatalog')
-
-del createZope3Bridge
-del z3IZCatalog
Modified: Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCatalog/ProgressHandler.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -18,7 +18,8 @@
from logging import getLogger
from DateTime.DateTime import DateTime
-from Interface import Interface
+from zope.interface import Interface
+from zope.interface import implements
LOG = getLogger('ProgressHandler')
@@ -54,7 +55,7 @@
class StdoutHandler:
""" A simple progress handler """
- __implements__ = IProgressHandler
+ implements(IProgressHandler)
def __init__(self, steps=100):
self._steps = steps
@@ -89,7 +90,7 @@
class ZLogHandler(StdoutHandler):
""" Use Zope logger"""
- __implements__ = IProgressHandler
+ implements(IProgressHandler)
def output(self, text):
LOG.info(text)
@@ -98,7 +99,7 @@
class FilelogHandler(StdoutHandler):
""" Use a custom file for logging """
- __implements__ = IProgressHandler
+ implements(IProgressHandler)
def __init__(self, filename, steps=100):
StdoutHandler.__init__(self, steps)
Modified: Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -34,14 +34,11 @@
manage_zcatalog_entries, manage_zcatalog_indexes, search_zcatalog
from ZODB.POSException import ConflictError
import transaction
-from Products.PluginIndexes.common.PluggableIndex \
- import PluggableIndexInterface
from Products.PluginIndexes.interfaces import IPluggableIndex
from zope.interface import implements
from Catalog import Catalog, CatalogError
-from interfaces import IZCatalog as z3IZCatalog
-from IZCatalog import IZCatalog as z2IZCatalog
+from interfaces import IZCatalog
from ProgressHandler import ZLogHandler
from ZCatalogIndexes import ZCatalogIndexes
@@ -82,8 +79,7 @@
Python program to catalog objects.
"""
- __implements__ = z2IZCatalog
- implements(z3IZCatalog)
+ implements(IZCatalog)
security = ClassSecurityInfo()
security.setPermissionDefault(manage_zcatalog_entries, ('Manager',))
@@ -958,8 +954,8 @@
# Convert the type by finding an appropriate product which supports
# this interface by that name. Bleah
- products = ObjectManager.all_meta_types(self, interfaces=(
- PluggableIndexInterface, IPluggableIndex))
+ products = ObjectManager.all_meta_types(self,
+ interfaces=(IPluggableIndex,))
p = None
Modified: Zope/trunk/lib/python/Products/ZCatalog/ZCatalogIndexes.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCatalog/ZCatalogIndexes.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCatalog/ZCatalogIndexes.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -23,8 +23,6 @@
from OFS.Folder import Folder
from OFS.ObjectManager import IFAwareObjectManager
from OFS.SimpleItem import SimpleItem
-from Products.PluginIndexes.common.PluggableIndex \
- import PluggableIndexInterface
from Products.PluginIndexes.interfaces import IPluggableIndex
@@ -37,7 +35,7 @@
the requested indexes in an object manager."""
# The interfaces we want to show up in our object manager
- _product_interfaces = (PluggableIndexInterface, IPluggableIndex)
+ _product_interfaces = (IPluggableIndex,)
meta_type = "ZCatalogIndex"
manage_options = ()
Modified: Zope/trunk/lib/python/Products/ZCatalog/tests/testCatalog.py
===================================================================
--- Zope/trunk/lib/python/Products/ZCatalog/tests/testCatalog.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZCatalog/tests/testCatalog.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -215,13 +215,6 @@
def _resolve_num(self, num):
return self.d[num]
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
- from Products.ZCatalog.IZCatalog import IZCatalog
- from Products.ZCatalog.ZCatalog import ZCatalog
-
- verifyClass(IZCatalog, ZCatalog)
-
def test_z3interfaces(self):
from Products.ZCatalog.interfaces import IZCatalog
from Products.ZCatalog.ZCatalog import ZCatalog
Modified: Zope/trunk/lib/python/Products/ZSQLMethods/SQL.py
===================================================================
--- Zope/trunk/lib/python/Products/ZSQLMethods/SQL.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Products/ZSQLMethods/SQL.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -21,7 +21,6 @@
from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from AccessControl.Permissions import change_database_methods
-from webdav.WriteLockInterface import WriteLockInterface
def SQLConnectionIDs(self):
"""Find SQL database connections in the current folder and above
@@ -120,7 +119,6 @@
employees/employee_id/1234/service_record
"""
- __implements__ = (WriteLockInterface,)
meta_type='Z SQL Method'
security = ClassSecurityInfo()
Added: Zope/trunk/lib/python/Products/ZSQLMethods/tests/__init__.py
===================================================================
--- Zope/trunk/lib/python/Products/ZSQLMethods/tests/__init__.py (rev 0)
+++ Zope/trunk/lib/python/Products/ZSQLMethods/tests/__init__.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -0,0 +1 @@
+# Unit tests for ZSQLMethods
Added: Zope/trunk/lib/python/Products/ZSQLMethods/tests/test_SQL.py
===================================================================
--- Zope/trunk/lib/python/Products/ZSQLMethods/tests/test_SQL.py (rev 0)
+++ Zope/trunk/lib/python/Products/ZSQLMethods/tests/test_SQL.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -0,0 +1,24 @@
+import unittest
+
+class SQLMethodTests(unittest.TestCase):
+
+ def _getTargetClass(self):
+ from Products.ZSQLMethods.SQL import SQL
+ return SQL
+
+ def _makeOne(self, *args, **kw):
+ return self._getTargetClass()(*args, **kw)
+
+ def test_class_conforms_to_IWriteLock(self):
+ from zope.interface.verify import verifyClass
+ from webdav.interfaces import IWriteLock
+ verifyClass(IWriteLock, self._getTargetClass())
+
+
+def test_suite():
+ return unittest.TestSuite((
+ unittest.makeSuite(SQLMethodTests),
+ ))
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
Modified: Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py
===================================================================
--- Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -629,6 +629,5 @@
class SQLMethodTracebackSupplement:
- #__implements__ = ITracebackSupplement
def __init__(self, sql):
self.object = sql
Modified: Zope/trunk/lib/python/ZPublisher/HTTPRangeSupport.py
===================================================================
--- Zope/trunk/lib/python/ZPublisher/HTTPRangeSupport.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/ZPublisher/HTTPRangeSupport.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -22,7 +22,7 @@
__version__='$Revision: 1.8 $'[11:-2]
import re, sys
-import Interface
+from zope.interface import Interface
WHITESPACE = re.compile('\s*', re.MULTILINE)
@@ -116,7 +116,7 @@
return expanded
-class HTTPRangeInterface(Interface.Base):
+class HTTPRangeInterface(Interface):
"""Objects implementing this Interface support the HTTP Range header.
Objects implementing support for the HTTP Range header will return partial
Modified: Zope/trunk/lib/python/ZPublisher/Iterators.py
===================================================================
--- Zope/trunk/lib/python/ZPublisher/Iterators.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/ZPublisher/Iterators.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,4 +1,5 @@
-from Interface import Interface
+from zope.interface import Interface
+from zope.interface import implements
class IStreamIterator(Interface):
"""
@@ -33,7 +34,7 @@
fixed-sized sequence of bytes.
"""
- __implements__ = (IStreamIterator,)
+ implements(IStreamIterator)
def __init__(self, name, mode='r', bufsize=-1, streamsize=1<<16):
file.__init__(self, name, mode, bufsize)
Modified: Zope/trunk/lib/python/ZPublisher/tests/testIterators.py
===================================================================
--- Zope/trunk/lib/python/ZPublisher/tests/testIterators.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/ZPublisher/tests/testIterators.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,5 +1,5 @@
import unittest
-from Interface.Verify import verifyClass
+from zope.interface.verify import verifyClass
from ZPublisher.Iterators import IStreamIterator, filestream_iterator
class TestFileStreamIterator(unittest.TestCase):
Modified: Zope/trunk/lib/python/ZServer/HTTPResponse.py
===================================================================
--- Zope/trunk/lib/python/ZServer/HTTPResponse.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/ZServer/HTTPResponse.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -251,7 +251,7 @@
def setBody(self, body, title='', is_error=0, **kw):
""" Accept either a stream iterator or a string as the body """
- if IStreamIterator.isImplementedBy(body):
+ if IStreamIterator.providedBy(body):
assert(self.headers.has_key('content-length'))
# wrap the iterator up in a producer that medusa can understand
self._bodyproducer = iterator_producer(body)
Modified: Zope/trunk/lib/python/ZServer/tests/test_responses.py
===================================================================
--- Zope/trunk/lib/python/ZServer/tests/test_responses.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/ZServer/tests/test_responses.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -19,6 +19,7 @@
from ZServer.PCGIServer import PCGIResponse
from ZServer.FCGIServer import FCGIResponse
from ZPublisher.Iterators import IStreamIterator
+from zope.interface import implements
import unittest
from cStringIO import StringIO
@@ -82,7 +83,7 @@
self.out.write(s)
class test_streamiterator:
- __implements__ = IStreamIterator
+ implements(IStreamIterator)
data = "hello"
done = 0
Modified: Zope/trunk/lib/python/webdav/EtagSupport.py
===================================================================
--- Zope/trunk/lib/python/webdav/EtagSupport.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/webdav/EtagSupport.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -17,7 +17,8 @@
import time
-from Interface import Interface
+from zope.interface import implements
+from zope.interface import Interface
from webdav.common import PreconditionFailed
@@ -71,7 +72,7 @@
can be rejected according to the type of header (If-Match,
If-None-Match).
"""
- __implements__ = (EtagBaseInterface,)
+ implements(EtagBaseInterface)
def http__etag(self, readonly=0):
try: etag = self.__etag
Modified: Zope/trunk/lib/python/webdav/LockItem.py
===================================================================
--- Zope/trunk/lib/python/webdav/LockItem.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/webdav/LockItem.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -24,7 +24,6 @@
from common import generateLockToken
from interfaces import ILockItem
-from WriteLockInterface import LockItemInterface
MAXTIMEOUT = (2L**32)-1 # Maximum timeout time
DEFAULTTIMEOUT = 12 * 60L # Default timeout
@@ -48,7 +47,6 @@
class LockItem(Persistent):
implements(ILockItem)
- __implements__ = (LockItemInterface,)
# Use the Zope 2.3 declarative security to manage access
security = ClassSecurityInfo()
Modified: Zope/trunk/lib/python/webdav/Lockable.py
===================================================================
--- Zope/trunk/lib/python/webdav/Lockable.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/webdav/Lockable.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -24,8 +24,6 @@
from EtagSupport import EtagSupport
from interfaces import ILockItem
from interfaces import IWriteLock
-from WriteLockInterface import LockItemInterface
-from WriteLockInterface import WriteLockInterface
class ResourceLockedError(Exception): pass
@@ -105,8 +103,7 @@
def wl_setLock(self, locktoken, lock):
locks = self.wl_lockmapping(create=1)
- if ILockItem.providedBy(lock) or \
- LockItemInterface.isImplementedBy(lock):
+ if ILockItem.providedBy(lock):
if locktoken == lock.getLockToken():
locks[locktoken] = lock
else:
@@ -134,8 +131,7 @@
# and replace.
if hasattr(self, '_dav_writelocks'):
del self._dav_writelocks
- if IWriteLock.providedBy(self) or \
- WriteLockInterface.isImplementedBy(self):
+ if IWriteLock.providedBy(self):
self._dav_writelocks = PersistentMapping()
# Call into a special hook used by LockNullResources to delete
@@ -155,6 +151,4 @@
return wl_isLockable(ob) and ob.wl_isLocked()
def wl_isLockable(ob):
- return (IWriteLock.providedBy(ob) or
- WriteLockInterface.isImplementedBy(ob))
-
+ return IWriteLock.providedBy(ob)
Modified: Zope/trunk/lib/python/webdav/NullResource.py
===================================================================
--- Zope/trunk/lib/python/webdav/NullResource.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/webdav/NullResource.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -37,7 +37,6 @@
from common import Locked, Conflict, PreconditionFailed, UnsupportedMediaType
from interfaces import IWriteLock
from Resource import Resource
-from WriteLockInterface import WriteLockInterface
from zope.contenttype import guess_content_type
@@ -47,7 +46,6 @@
"""Null resources are used to handle HTTP method calls on
objects which do not yet exist in the url namespace."""
- __implements__ = (WriteLockInterface,)
__null_resource__=1
security = ClassSecurityInfo()
@@ -105,9 +103,7 @@
parent = self.__parent__
ifhdr = REQUEST.get_header('If', '')
- if (IWriteLock.providedBy(parent) or
- WriteLockInterface.isImplementedBy(parent)) and \
- parent.wl_isLocked():
+ if IWriteLock.providedBy(parent) and parent.wl_isLocked():
if ifhdr:
parent.dav__simpleifhandler(REQUEST, RESPONSE, col=1)
else:
@@ -186,9 +182,7 @@
raise Forbidden, 'Cannot create collection at this location.'
ifhdr = REQUEST.get_header('If', '')
- if (IWriteLock.providedBy(parent) or
- WriteLockInterface.isImplementedBy(parent)) and \
- parent.wl_isLocked():
+ if IWriteLock.providedBy(parent) and parent.wl_isLocked():
if ifhdr:
parent.dav__simpleifhandler(REQUEST, RESPONSE, col=1)
else:
@@ -219,9 +213,7 @@
name = self.__name__
parent = self.__parent__
- if (IWriteLock.providedBy(parent) or
- WriteLockInterface.isImplementedBy(parent)) and \
- parent.wl_isLocked():
+ if IWriteLock.providedBy(parent) and parent.wl_isLocked():
if ifhdr:
parent.dav__simpleifhandler(REQUEST, RESPONSE, col=1)
else:
@@ -267,7 +259,6 @@
MKCOL deletes the LockNull resource from its container and replaces it
with the target object. An UNLOCK deletes it. """
- __implements__ = (WriteLockInterface,)
__locknull_resource__ = 1
meta_type = 'WebDAV LockNull Resource'
@@ -386,9 +377,7 @@
# First we need to see if the parent of the locknull is locked, and
# if the user owns that lock (checked by handling the information in
# the If header).
- if (IWriteLock.providedBy(parent) or
- WriteLockInterface.isImplementedBy(parent)) and \
- parent.wl_isLocked():
+ if IWriteLock.providedBy(parent) and parent.wl_isLocked():
itrue = parent.dav__simpleifhandler(REQUEST, RESPONSE, 'PUT',
col=1, url=parenturl,
refresh=1)
@@ -426,8 +415,7 @@
raise Forbidden, sys.exc_info()[1]
# Put the locks on the new object
- if not (IWriteLock.providedBy(ob) or
- WriteLockInterface.isImplementedBy(ob)):
+ if not IWriteLock.providedBy(ob):
raise MethodNotAllowed, (
'The target object type cannot be locked')
for token, lock in locks:
@@ -460,9 +448,7 @@
# If the parent object is locked, that information should be in the
# if-header if the user owns a lock on the parent
- if (IWriteLock.providedBy(parent) or
- WriteLockInterface.isImplementedBy(parent)) and \
- parent.wl_isLocked():
+ if IWriteLock.providedBy(parent) and parent.wl_isLocked():
itrue = parent.dav__simpleifhandler(REQUEST, RESPONSE, 'MKCOL',
col=1, url=parenturl,
refresh=1)
Modified: Zope/trunk/lib/python/webdav/Resource.py
===================================================================
--- Zope/trunk/lib/python/webdav/Resource.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/webdav/Resource.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -46,7 +46,6 @@
from common import Locked, Conflict, PreconditionFailed
from interfaces import IDAVResource
from interfaces import IWriteLock
-from WriteLockInterface import WriteLockInterface
from zope.event import notify
from zope.lifecycleevent import ObjectCopiedEvent
@@ -90,7 +89,7 @@
response.setHeader('Date', rfc1123_date(), 1)
# HTTP Range support
- if HTTPRangeInterface.isImplementedBy(self):
+ if HTTPRangeInterface.providedBy(self):
response.setHeader('Accept-Ranges', 'bytes')
else:
response.setHeader('Accept-Ranges', 'none')
@@ -263,9 +262,7 @@
# We're locked, and no if header was passed in, so
# the client doesn't own a lock.
raise Locked, 'Resource is locked.'
- elif (IWriteLock.providedBy(parent) or
- WriteLockInterface.isImplementedBy(parent)) and \
- parent.wl_isLocked():
+ elif IWriteLock.providedBy(parent) and parent.wl_isLocked():
if ifhdr:
parent.dav__simpleifhandler(REQUEST, RESPONSE, 'DELETE', col=1)
else:
@@ -394,9 +391,7 @@
if existing:
# The destination itself exists, so we need to check its locks
destob = aq_base(parent)._getOb(name)
- if (IWriteLock.providedBy(destob) or
- WriteLockInterface.isImplementedBy(destob)) and \
- destob.wl_isLocked():
+ if IWriteLock.providedBy(destob) and destob.wl_isLocked():
if ifhdr:
itrue = destob.dav__simpleifhandler(
REQUEST, RESPONSE, 'COPY', refresh=1)
@@ -404,9 +399,7 @@
raise PreconditonFailed
else:
raise Locked, 'Destination is locked.'
- elif (IWriteLock.providedBy(parent) or
- WriteLockInterface.isImplementedBy(parent)) and \
- parent.wl_isLocked():
+ elif IWriteLock.providedBy(parent) and parent.wl_isLocked():
if ifhdr:
parent.dav__simpleifhandler(REQUEST, RESPONSE, 'COPY',
refresh=1)
@@ -498,9 +491,7 @@
if existing:
# The destination itself exists, so we need to check its locks
destob = aq_base(parent)._getOb(name)
- if (IWriteLock.providedBy(destob) or
- WriteLockInterface.isImplementedBy(destob)) and \
- destob.wl_isLocked():
+ if IWriteLock.providedBy(destob) and destob.wl_isLocked():
if ifhdr:
itrue = destob.dav__simpleifhandler(
REQUEST, RESPONSE, 'MOVE', url=dest, refresh=1)
@@ -508,9 +499,7 @@
raise PreconditionFailed
else:
raise Locked, 'Destination is locked.'
- elif (IWriteLock.providedBy(parent) or
- WriteLockInterface.isImplementedBy(parent)) and \
- parent.wl_isLocked():
+ elif IWriteLock.providedBy(parent) and parent.wl_isLocked():
# There's no existing object in the destination folder, so
# we need to check the folders locks since we're changing its
# member list
Deleted: Zope/trunk/lib/python/webdav/WriteLockInterface.py
===================================================================
--- Zope/trunk/lib/python/webdav/WriteLockInterface.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/webdav/WriteLockInterface.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -1,30 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Write lock interfaces.
-
-$Id$
-"""
-
-
-# create WriteLockInterface
-from Interface.bridge import createZope3Bridge
-from interfaces import ILockItem
-from interfaces import IWriteLock
-import WriteLockInterface
-
-createZope3Bridge(ILockItem, WriteLockInterface, 'LockItemInterface')
-createZope3Bridge(IWriteLock, WriteLockInterface, 'WriteLockInterface')
-
-del createZope3Bridge
-del ILockItem
-del IWriteLock
Modified: Zope/trunk/lib/python/webdav/davcmds.py
===================================================================
--- Zope/trunk/lib/python/webdav/davcmds.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/webdav/davcmds.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -30,7 +30,6 @@
from common import PreconditionFailed
from interfaces import IWriteLock
from LockItem import LockItem
-from WriteLockInterface import WriteLockInterface
from xmltools import XmlParser
@@ -368,8 +367,7 @@
errmsg = "403 Forbidden"
try:
- if not (IWriteLock.providedBy(obj) or
- WriteLockInterface.isImplementedBy(obj)):
+ if not IWriteLock.providedBy(obj):
if top:
# This is the top level object in the apply, so we
# do want an error
@@ -433,8 +431,7 @@
url = url + '/'
errmsg = None
- islockable = IWriteLock.providedBy(obj) or \
- WriteLockInterface.isImplementedBy(obj)
+ islockable = IWriteLock.providedBy(obj)
if islockable:
if obj.wl_hasLock(token):
@@ -474,8 +471,7 @@
if iscol:
for ob in obj.objectValues():
if hasattr(ob, '__dav_resource__') and \
- (IWriteLock.providedBy(ob) or
- WriteLockInterface.isImplementedBy(ob)):
+ IWriteLock.providedBy(ob):
uri = urljoin(url, absattr(ob.getId()))
self.apply(ob, token, uri, result, top=0)
if not top:
@@ -502,8 +498,7 @@
errmsg = None
parent = aq_parent(obj)
- islockable = IWriteLock.providedBy(obj) or \
- WriteLockInterface.isImplementedBy(obj)
+ islockable = IWriteLock.providedBy(obj)
if parent and (not user.has_permission('Delete objects', parent)):
# User doesn't have permission to delete this object
errmsg = "403 Forbidden"
Modified: Zope/trunk/lib/python/webdav/tests/testEtagSupport.py
===================================================================
--- Zope/trunk/lib/python/webdav/tests/testEtagSupport.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/webdav/tests/testEtagSupport.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -3,8 +3,8 @@
class TestEtagSupport(unittest.TestCase):
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
+ def test_z3interfaces(self):
+ from zope.interface.verify import verifyClass
from webdav.EtagSupport import EtagBaseInterface
from webdav.EtagSupport import EtagSupport
Modified: Zope/trunk/lib/python/webdav/tests/testLockItem.py
===================================================================
--- Zope/trunk/lib/python/webdav/tests/testLockItem.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/webdav/tests/testLockItem.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -3,13 +3,6 @@
class TestLockItem(unittest.TestCase):
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
- from webdav.LockItem import LockItem
- from webdav.WriteLockInterface import LockItemInterface
-
- verifyClass(LockItemInterface, LockItem)
-
def test_z3interfaces(self):
from webdav.interfaces import ILockItem
from webdav.LockItem import LockItem
Modified: Zope/trunk/lib/python/webdav/tests/testNullResource.py
===================================================================
--- Zope/trunk/lib/python/webdav/tests/testNullResource.py 2008-04-28 15:11:16 UTC (rev 85816)
+++ Zope/trunk/lib/python/webdav/tests/testNullResource.py 2008-04-28 15:18:59 UTC (rev 85817)
@@ -3,13 +3,6 @@
class TestLockNullResource(unittest.TestCase):
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
- from webdav.NullResource import LockNullResource
- from webdav.WriteLockInterface import WriteLockInterface
-
- verifyClass(WriteLockInterface, LockNullResource)
-
def test_z3interfaces(self):
from webdav.interfaces import IWriteLock
from webdav.NullResource import LockNullResource
@@ -20,13 +13,6 @@
class TestNullResource(unittest.TestCase):
- def test_z2interfaces(self):
- from Interface.Verify import verifyClass
- from webdav.NullResource import NullResource
- from webdav.WriteLockInterface import WriteLockInterface
-
- verifyClass(WriteLockInterface, NullResource)
-
def test_z3interfaces(self):
from webdav.interfaces import IWriteLock
from webdav.NullResource import NullResource
More information about the Zope-Checkins
mailing list