[CMF-checkins] CVS: Products/CMFDefault -
DefaultWorkflow.py:1.27.6.1 DiscussionItem.py:1.45.6.1
DiscussionTool.py:1.23.6.1 Document.py:1.77.4.1
DublinCore.py:1.43.6.1 Favorite.py:1.25.18.1
File.py:1.32.14.1 Image.py:1.31.14.1 Link.py:1.36.4.1
MembershipTool.py:1.50.4.1 MetadataTool.py:1.28.6.1
NewsItem.py:1.25.18.1 PropertiesTool.py:1.14.18.1
RegistrationTool.py:1.33.6.1 SyndicationTool.py:1.29.6.1
bridge.zcml:1.1.8.1
Tres Seaver
tseaver at palladion.com
Fri Jul 15 18:41:51 EDT 2005
Update of /cvs-repository/Products/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv16776/CMFDefault
Modified Files:
Tag: tseaver-z3_interfaces-branch
DefaultWorkflow.py DiscussionItem.py DiscussionTool.py
Document.py DublinCore.py Favorite.py File.py Image.py Link.py
MembershipTool.py MetadataTool.py NewsItem.py
PropertiesTool.py RegistrationTool.py SyndicationTool.py
bridge.zcml
Log Message:
Branch for Z3-ification of CMF interfaces
- All interfaces declared in the CMF are now Zope3-style interfaces
(the one remaining exception is to leave Zope2's
'webdav.WriteLockInterface' declared by CMFCore.PortalContent and
derivatives.).
TOOD
- Clean up XXX'es noted during this pass.
=== Products/CMFDefault/DefaultWorkflow.py 1.27 => 1.27.6.1 ===
--- Products/CMFDefault/DefaultWorkflow.py:1.27 Sun Mar 20 15:55:04 2005
+++ Products/CMFDefault/DefaultWorkflow.py Fri Jul 15 18:41:20 2005
@@ -22,8 +22,9 @@
from DateTime import DateTime
from Globals import InitializeClass
-from Products.CMFCore.interfaces.portal_workflow \
- import WorkflowDefinition as IWorkflowDefinition
+from zope.interface import implements
+
+from Products.CMFCore.interfaces import IWorkflowDefinition
from Products.CMFCore.utils import _checkPermission
from Products.CMFCore.utils import _modifyPermissionMappings
from Products.CMFCore.utils import getToolByName
@@ -40,7 +41,7 @@
""" Default workflow definition.
"""
- __implements__ = IWorkflowDefinition
+ implements(IWorkflowDefinition)
meta_type = 'Workflow'
id = 'default_workflow'
=== Products/CMFDefault/DiscussionItem.py 1.45 => 1.45.6.1 ===
--- Products/CMFDefault/DiscussionItem.py:1.45 Thu Apr 7 12:38:47 2005
+++ Products/CMFDefault/DiscussionItem.py Fri Jul 15 18:41:20 2005
@@ -23,8 +23,10 @@
from Globals import PersistentMapping
from OFS.Traversable import Traversable
-from Products.CMFCore.interfaces.Discussions import Discussable
-from Products.CMFCore.interfaces.Discussions import DiscussionResponse
+from zope.interface import implements, implementedBy
+
+from Products.CMFCore.interfaces import IDiscussable
+from Products.CMFCore.interfaces import IDiscussionResponse
from Products.CMFCore.utils import getToolByName
from Document import Document
@@ -93,7 +95,9 @@
Class for content which is a response to other content.
"""
- __implements__ = (DiscussionResponse, Document.__implements__)
+ __implements__ = Document.__implements__ # WriteLockInterface
+
+ implements(implementedBy(Document))
meta_type = 'Discussion Item'
portal_type = 'Discussion Item'
@@ -117,12 +121,12 @@
return self.creators
#
- # DiscussionResponse interface
+ # IDiscussionResponse interface
#
security.declareProtected(View, 'inReplyTo')
def inReplyTo( self, REQUEST=None ):
"""
- Return the Discussable object to which we are a reply.
+ Return the IDiscussable object to which we are a reply.
Two cases obtain:
@@ -178,7 +182,7 @@
hold the discussion threads.
"""
- __implements__ = Discussable
+ implements(IDiscussable)
# for the security machinery to allow traversal
#__roles__ = None
@@ -283,7 +287,7 @@
return self._container.values()
#
- # Discussable interface
+ # IDiscussable interface
#
security.declareProtected(ReplyToItem, 'createReply')
def createReply( self, title, text, Creator=None, text_format='structured-text' ):
@@ -368,7 +372,7 @@
security.declareProtected(View, 'getReplies')
def getReplies( self ):
"""
- Return a sequence of the DiscussionResponse objects which are
+ Return a sequence of the IDiscussionResponse objects which are
associated with this Discussable
"""
objects = []
=== Products/CMFDefault/DiscussionTool.py 1.23 => 1.23.6.1 ===
--- Products/CMFDefault/DiscussionTool.py:1.23 Sun Mar 20 15:35:01 2005
+++ Products/CMFDefault/DiscussionTool.py Fri Jul 15 18:41:20 2005
@@ -21,13 +21,13 @@
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements, implementedBy
+
from Products.CMFCore.ActionInformation import ActionInformation
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.Expression import Expression
-from Products.CMFCore.interfaces.Discussions \
- import DiscussionResponse as IDiscussionResponse
-from Products.CMFCore.interfaces.portal_discussion \
- import portal_discussion as IDiscussionTool
+from Products.CMFCore.interfaces import IDiscussionResponse
+from Products.CMFCore.interfaces import IDiscussionTool
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.utils import UniqueObject
@@ -44,7 +44,8 @@
""" Links content to discussions.
"""
- __implements__ = (IDiscussionTool, ActionProviderBase.__implements__)
+ implements(IDiscussionTool,
+ implementedBy(ActionProviderBase))
id = 'portal_discussion'
meta_type = 'Default Discussion Tool'
@@ -100,7 +101,7 @@
if not self.isDiscussionAllowedFor( content ):
raise DiscussionNotAllowed
- if not IDiscussionResponse.isImplementedBy(content) and \
+ if not IDiscussionResponse.providedBy(content) and \
getattr( aq_base(content), 'talkback', None ) is None:
# Discussion Items use the DiscussionItemContainer object of the
# related content item, so only create one for other content items
=== Products/CMFDefault/Document.py 1.77 => 1.77.4.1 ===
--- Products/CMFDefault/Document.py:1.77 Sat Jun 18 08:10:30 2005
+++ Products/CMFDefault/Document.py Fri Jul 15 18:41:20 2005
@@ -28,11 +28,13 @@
from Products.CMFCore.utils import contributorsplitter
from Products.CMFCore.utils import keywordsplitter
+from zope.interface import implements, implementedBy
+
from DublinCore import DefaultDublinCoreImpl
from exceptions import EditingConflict
from exceptions import ResourceLockedError
-from interfaces.Document import IDocument
-from interfaces.Document import IMutableDocument
+from interfaces import IDocument
+from interfaces import IMutableDocument
from permissions import ModifyPortalContent
from permissions import View
from utils import _dtmldir
@@ -86,9 +88,12 @@
class Document(PortalContent, DefaultDublinCoreImpl):
""" A Document - Handles both StructuredText and HTML """
- __implements__ = (IDocument, IMutableDocument,
- PortalContent.__implements__,
- DefaultDublinCoreImpl.__implements__)
+ __implements__ = PortalContent.__implements__
+
+ implements(IDocument,
+ IMutableDocument,
+ implementedBy(PortalContent),
+ implementedBy(DefaultDublinCoreImpl))
meta_type = 'Document'
effective_date = expiration_date = None
=== Products/CMFDefault/DublinCore.py 1.43 => 1.43.6.1 ===
--- Products/CMFDefault/DublinCore.py:1.43 Tue Apr 26 10:45:48 2005
+++ Products/CMFDefault/DublinCore.py Fri Jul 15 18:41:20 2005
@@ -22,9 +22,11 @@
from Globals import InitializeClass
from OFS.PropertyManager import PropertyManager
-from Products.CMFCore.interfaces.DublinCore import CatalogableDublinCore
-from Products.CMFCore.interfaces.DublinCore import DublinCore
-from Products.CMFCore.interfaces.DublinCore import MutableDublinCore
+from zope.interface import implements
+
+from Products.CMFCore.interfaces import IDublinCore
+from Products.CMFCore.interfaces import ICatalogableDublinCore
+from Products.CMFCore.interfaces import IMutableDublinCore
from Products.CMFCore.utils import getToolByName
from permissions import ModifyPortalContent
@@ -42,7 +44,9 @@
class DefaultDublinCoreImpl( PropertyManager ):
""" Mix-in class which provides Dublin Core methods.
"""
- __implements__ = DublinCore, CatalogableDublinCore, MutableDublinCore
+ implements(IDublinCore,
+ ICatalogableDublinCore,
+ IMutableDublinCore)
security = ClassSecurityInfo()
=== Products/CMFDefault/Favorite.py 1.25 => 1.25.18.1 ===
--- Products/CMFDefault/Favorite.py:1.25 Thu Aug 12 11:07:40 2004
+++ Products/CMFDefault/Favorite.py Fri Jul 15 18:41:20 2005
@@ -21,6 +21,8 @@
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
+from zope.interface import implements, implementedBy
+
from Products.CMFCore.utils import getToolByName
from permissions import View
@@ -79,6 +81,7 @@
"""
__implements__ = Link.__implements__ # redundant, but explicit
+ implements(implementedBy(Link))
meta_type='Favorite'
=== Products/CMFDefault/File.py 1.32 => 1.32.14.1 ===
--- Products/CMFDefault/File.py:1.32 Tue Aug 24 17:12:58 2004
+++ Products/CMFDefault/File.py Fri Jul 15 18:41:20 2005
@@ -22,6 +22,8 @@
from Products.CMFCore.PortalContent import PortalContent
+from zope.interface import implements, implementedBy
+
from DublinCore import DefaultDublinCoreImpl
from permissions import View
from permissions import ModifyPortalContent
@@ -126,9 +128,10 @@
# this problem altogether. getId is the new way, accessing .id is
# deprecated.
- __implements__ = ( PortalContent.__implements__
- , DefaultDublinCoreImpl.__implements__
- )
+ __implements__ = PortalContent.__implements__ # WriteLockInterface
+
+ implements(implementedBy(PortalContent),
+ implementedBy(DefaultDublinCoreImpl))
meta_type='Portal File'
effective_date = expiration_date = None
=== Products/CMFDefault/Image.py 1.31 => 1.31.14.1 ===
--- Products/CMFDefault/Image.py:1.31 Tue Aug 24 17:12:58 2004
+++ Products/CMFDefault/Image.py Fri Jul 15 18:41:20 2005
@@ -21,6 +21,8 @@
from Products.CMFCore.PortalContent import PortalContent
+from zope.interface import implements, implementedBy
+
from DublinCore import DefaultDublinCoreImpl
from permissions import View
from permissions import ModifyPortalContent
@@ -118,9 +120,10 @@
# this problem altogether. getId is the new way, accessing .id is
# deprecated.
- __implements__ = ( PortalContent.__implements__
- , DefaultDublinCoreImpl.__implements__
- )
+ __implements__ = PortalContent.__implements__ # WriteLockInterface
+
+ implements(implementedBy(PortalContent),
+ implementedBy(DefaultDublinCoreImpl))
meta_type='Portal Image'
effective_date = expiration_date = None
=== Products/CMFDefault/Link.py 1.36 => 1.36.4.1 ===
--- Products/CMFDefault/Link.py:1.36 Wed Jun 15 10:17:38 2005
+++ Products/CMFDefault/Link.py Fri Jul 15 18:41:20 2005
@@ -26,6 +26,8 @@
from Products.CMFCore.utils import contributorsplitter
from Products.CMFCore.utils import keywordsplitter
+from zope.interface import implements, implementedBy
+
from DublinCore import DefaultDublinCoreImpl
from exceptions import ResourceLockedError
from permissions import ModifyPortalContent
@@ -85,10 +87,10 @@
"""
A Link
"""
+ __implements__ = PortalContent.__implements__ # WriteLockInterface
- __implements__ = ( PortalContent.__implements__
- , DefaultDublinCoreImpl.__implements__
- )
+ implements(implementedBy(PortalContent),
+ implementedBy(DefaultDublinCoreImpl))
meta_type = 'Link'
URL_FORMAT = format = 'text/url'
=== Products/CMFDefault/MembershipTool.py 1.50 => 1.50.4.1 ===
--- Products/CMFDefault/MembershipTool.py:1.50 Thu Jun 16 06:06:12 2005
+++ Products/CMFDefault/MembershipTool.py Fri Jul 15 18:41:20 2005
@@ -22,6 +22,8 @@
from Globals import DTMLFile
from Globals import InitializeClass
+from zope.interface import implements, implementedBy
+
from Products.CMFCore.ActionInformation import ActionInformation as AI
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.Expression import Expression
@@ -31,8 +33,7 @@
from Products.CMFCore.utils import getToolByName
from Document import addDocument
-from interfaces.portal_membership \
- import portal_membership as IMembershipTool
+from interfaces import IMembershipTool
from permissions import ListPortalMembers
from permissions import ManagePortal
from permissions import ManageUsers
@@ -55,7 +56,8 @@
""" Implement 'portal_membership' interface using "stock" policies.
"""
- __implements__ = (IMembershipTool, ActionProviderBase.__implements__)
+ implements(IMembershipTool,
+ implementedBy(ActionProviderBase))
meta_type = 'Default Membership Tool'
_actions = (
=== Products/CMFDefault/MetadataTool.py 1.28 => 1.28.6.1 ===
--- Products/CMFDefault/MetadataTool.py:1.28 Wed May 4 17:34:46 2005
+++ Products/CMFDefault/MetadataTool.py Fri Jul 15 18:41:20 2005
@@ -22,9 +22,10 @@
from Globals import PersistentMapping
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements, implementedBy
+
from Products.CMFCore.ActionProviderBase import ActionProviderBase
-from Products.CMFCore.interfaces.portal_metadata \
- import portal_metadata as IMetadataTool
+from Products.CMFCore.interfaces import IMetadataTool
from Products.CMFCore.utils import UniqueObject
from exceptions import MetadataError
@@ -201,7 +202,8 @@
class MetadataTool( UniqueObject, SimpleItem, ActionProviderBase ):
- __implements__ = (IMetadataTool, ActionProviderBase.__implements__)
+ implements(IMetadataTool,
+ implementedBy(ActionProviderBase))
id = 'portal_metadata'
meta_type = 'Default Metadata Tool'
=== Products/CMFDefault/NewsItem.py 1.25 => 1.25.18.1 ===
--- Products/CMFDefault/NewsItem.py:1.25 Thu Aug 12 11:07:40 2004
+++ Products/CMFDefault/NewsItem.py Fri Jul 15 18:41:20 2005
@@ -18,6 +18,8 @@
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
+from zope.interface import implements, implementedBy
+
from Document import Document
from permissions import ModifyPortalContent
from permissions import View
@@ -81,6 +83,7 @@
"""
__implements__ = Document.__implements__ # redundant, but explicit
+ implements(implementedBy(Document))
meta_type='News Item'
text_format = 'html'
=== Products/CMFDefault/PropertiesTool.py 1.14 => 1.14.18.1 ===
--- Products/CMFDefault/PropertiesTool.py:1.14 Thu Aug 12 11:07:40 2004
+++ Products/CMFDefault/PropertiesTool.py Fri Jul 15 18:41:20 2005
@@ -20,19 +20,21 @@
from Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
+from zope.interface import implements, implementedBy
+
from Products.CMFCore.utils import UniqueObject
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.ActionInformation import ActionInformation
from Products.CMFCore.Expression import Expression
-from Products.CMFCore.interfaces.portal_properties \
- import portal_properties as IPropertiesTool
+from Products.CMFCore.interfaces import IPropertiesTool
from permissions import ManagePortal
from utils import _dtmldir
class PropertiesTool(UniqueObject, SimpleItem, ActionProviderBase):
- __implements__ = (IPropertiesTool, ActionProviderBase.__implements__)
+ implements(IPropertiesTool,
+ implementedBy(ActionProviderBase))
id = 'portal_properties'
meta_type = 'Default Properties Tool'
=== Products/CMFDefault/RegistrationTool.py 1.33 => 1.33.6.1 ===
--- Products/CMFDefault/RegistrationTool.py:1.33 Mon Mar 7 16:51:14 2005
+++ Products/CMFDefault/RegistrationTool.py Fri Jul 15 18:41:20 2005
@@ -19,6 +19,8 @@
from Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
+from zope.interface import implements, implementedBy
+
from Products.CMFCore.utils import _checkPermission
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.ActionInformation import ActionInformation
@@ -35,7 +37,7 @@
""" Manage through-the-web signup policies.
"""
- __implements__ = BaseTool.__implements__
+ implements(implementedBy(BaseTool))
meta_type = 'Default Registration Tool'
_actions = ( ActionInformation( id='join'
=== Products/CMFDefault/SyndicationTool.py 1.29 => 1.29.6.1 ===
--- Products/CMFDefault/SyndicationTool.py:1.29 Mon Jun 13 05:17:08 2005
+++ Products/CMFDefault/SyndicationTool.py Fri Jul 15 18:41:20 2005
@@ -24,6 +24,8 @@
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements, implementedBy
+
from Products.CMFCore.ActionInformation import ActionInformation
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.Expression import Expression
@@ -44,7 +46,7 @@
syndication of folder content as RSS.
"""
- __implements__ = ActionProviderBase.__implements__
+ implements(implementedBy(ActionProviderBase))
id = 'portal_syndication'
meta_type = 'Default Syndication Tool'
=== Products/CMFDefault/bridge.zcml 1.1 => 1.1.8.1 ===
--- Products/CMFDefault/bridge.zcml:1.1 Mon Jun 13 13:32:06 2005
+++ Products/CMFDefault/bridge.zcml Fri Jul 15 18:41:20 2005
@@ -2,6 +2,8 @@
xmlns="http://namespaces.zope.org/five"
>
+ <!--
+
<bridge
zope2=".interfaces.Document.IDocument"
package=".interfaces"
@@ -19,5 +21,6 @@
package=".interfaces"
name="IMembershipTool"
/>
+ -->
</configure>
More information about the CMF-checkins
mailing list