[CMF-checkins] SVN: CMF/trunk/CMF some cleanup:
Yvo Schubbe
y.2005- at wcm-solutions.de
Mon Sep 12 08:01:47 EDT 2005
Log message for revision 38447:
some cleanup:
- removed '_actions' from tools: '_actions' is inherited from ActionProviderBase
- import cleanup
- whitespace cleanup
Changed:
U CMF/trunk/CMFCore/ActionsTool.py
U CMF/trunk/CMFCore/CatalogTool.py
U CMF/trunk/CMFCore/MemberDataTool.py
U CMF/trunk/CMFCore/MembershipTool.py
U CMF/trunk/CMFCore/SkinsTool.py
U CMF/trunk/CMFCore/URLTool.py
U CMF/trunk/CMFCore/UndoTool.py
U CMF/trunk/CMFDefault/DiscussionTool.py
U CMF/trunk/CMFDefault/MembershipTool.py
U CMF/trunk/CMFDefault/MetadataTool.py
U CMF/trunk/CMFDefault/PropertiesTool.py
U CMF/trunk/CMFDefault/RegistrationTool.py
U CMF/trunk/CMFDefault/SyndicationTool.py
-=-
Modified: CMF/trunk/CMFCore/ActionsTool.py
===================================================================
--- CMF/trunk/CMFCore/ActionsTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFCore/ActionsTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -21,13 +21,10 @@
from OFS.ObjectManager import IFAwareObjectManager
from OFS.OrderedFolder import OrderedFolder
-from ActionInformation import ActionInformation
from ActionProviderBase import ActionProviderBase
-from Expression import Expression
from interfaces.portal_actions import ActionCategory as IActionCategory
from interfaces.portal_actions import ActionProvider as IActionProvider
from interfaces.portal_actions import portal_actions as IActionsTool
-from permissions import ListFolderContents
from permissions import ManagePortal
from utils import _dtmldir
from utils import UniqueObject
@@ -35,6 +32,7 @@
class ActionsTool(UniqueObject, IFAwareObjectManager, OrderedFolder,
ActionProviderBase):
+
"""
Weave together the various sources of "actions" which are apropos
to the current user and context.
@@ -46,30 +44,8 @@
id = 'portal_actions'
meta_type = 'CMF Actions Tool'
_product_interfaces = (IActionCategory,)
- _actions = (ActionInformation(id='folderContents'
- , title='Folder contents'
- , action=Expression(
- text='string:${folder_url}/folder_contents')
- , condition=Expression(
- text='python: folder is not object')
- , permissions=(ListFolderContents,)
- , category='folder'
- , visible=1
- )
- ,
- )
+ action_providers = ('portal_types', 'portal_workflow', 'portal_actions')
- action_providers = ( 'portal_membership'
- , 'portal_actions'
- , 'portal_registration'
- , 'portal_types'
- , 'portal_discussion'
- , 'portal_undo'
- , 'portal_syndication'
- , 'portal_workflow'
- , 'portal_properties'
- )
-
security = ClassSecurityInfo()
manage_options = ( ( OrderedFolder.manage_options[0],
Modified: CMF/trunk/CMFCore/CatalogTool.py
===================================================================
--- CMF/trunk/CMFCore/CatalogTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFCore/CatalogTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -20,7 +20,6 @@
from DateTime import DateTime
from Globals import DTMLFile
from Globals import InitializeClass
-from Products.ZCatalog.ZCatalog import LOG
from Products.ZCatalog.ZCatalog import ZCatalog
from Products.ZCTextIndex.HTMLSplitter import HTMLWordSplitter
from Products.ZCTextIndex.Lexicon import CaseNormalizer
@@ -78,6 +77,7 @@
class CatalogTool(UniqueObject, ZCatalog, ActionProviderBase):
+
""" This is a ZCatalog that filters catalog queries.
"""
@@ -86,7 +86,6 @@
id = 'portal_catalog'
meta_type = 'CMF Catalog'
- _actions = ()
security = ClassSecurityInfo()
Modified: CMF/trunk/CMFCore/MemberDataTool.py
===================================================================
--- CMF/trunk/CMFCore/MemberDataTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFCore/MemberDataTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -39,7 +39,9 @@
_marker = [] # Create a new marker object.
-class MemberDataTool (UniqueObject, SimpleItem, PropertyManager, ActionProviderBase):
+class MemberDataTool(UniqueObject, SimpleItem, PropertyManager,
+ ActionProviderBase):
+
""" This tool wraps user objects, making them act as Member objects.
"""
@@ -47,8 +49,6 @@
id = 'portal_memberdata'
meta_type = 'CMF Member Data Tool'
- _actions = ()
-
_v_temps = None
_properties = ()
@@ -235,9 +235,12 @@
class CleanupTemp:
+
"""Used to cleanup _v_temps at the end of the request."""
+
def __init__(self, tool):
self._tool = tool
+
def __del__(self):
try:
del self._tool._v_temps
Modified: CMF/trunk/CMFCore/MembershipTool.py
===================================================================
--- CMF/trunk/CMFCore/MembershipTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFCore/MembershipTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -47,6 +47,7 @@
class MembershipTool(UniqueObject, Folder, ActionProviderBase):
+
""" This tool accesses member data through an acl_users object.
It can be replaced with something that accesses member data in a
@@ -57,8 +58,6 @@
id = 'portal_membership'
meta_type = 'CMF Membership Tool'
- _actions = ()
-
memberareaCreationFlag = 1
security = ClassSecurityInfo()
Modified: CMF/trunk/CMFCore/SkinsTool.py
===================================================================
--- CMF/trunk/CMFCore/SkinsTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFCore/SkinsTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -56,6 +56,7 @@
class SkinsTool(UniqueObject, SkinsContainer, Folder, ActionProviderBase):
+
""" This tool is used to supply skins to a portal.
"""
@@ -64,8 +65,6 @@
id = 'portal_skins'
meta_type = 'CMF Skins Tool'
- _actions = ()
-
allow_any = 0
cookie_persistence = 0
default_skin = ''
Modified: CMF/trunk/CMFCore/URLTool.py
===================================================================
--- CMF/trunk/CMFCore/URLTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFCore/URLTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -23,15 +23,15 @@
from OFS.SimpleItem import SimpleItem
from ActionProviderBase import ActionProviderBase
+from interfaces.portal_url import portal_url as IURLTool
from permissions import ManagePortal
from permissions import View
from utils import _dtmldir
from utils import UniqueObject
-from interfaces.portal_url import portal_url as IURLTool
-
class URLTool(UniqueObject, SimpleItem, ActionProviderBase):
+
""" CMF URL Tool.
"""
@@ -39,7 +39,6 @@
id = 'portal_url'
meta_type = 'CMF URL Tool'
- _actions = ()
security = ClassSecurityInfo()
security.declareObjectProtected(View)
Modified: CMF/trunk/CMFCore/UndoTool.py
===================================================================
--- CMF/trunk/CMFCore/UndoTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFCore/UndoTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -20,10 +20,8 @@
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
-from ActionInformation import ActionInformation
from ActionProviderBase import ActionProviderBase
from exceptions import AccessControl_Unauthorized
-from Expression import Expression
from interfaces.portal_undo import portal_undo as IUndoTool
from permissions import ListUndoableChanges
from permissions import ManagePortal
@@ -33,7 +31,8 @@
from utils import UniqueObject
-class UndoTool (UniqueObject, SimpleItem, ActionProviderBase):
+class UndoTool(UniqueObject, SimpleItem, ActionProviderBase):
+
""" This tool is used to undo changes.
"""
@@ -41,7 +40,6 @@
id = 'portal_undo'
meta_type = 'CMF Undo Tool'
- _actions = ()
security = ClassSecurityInfo()
Modified: CMF/trunk/CMFDefault/DiscussionTool.py
===================================================================
--- CMF/trunk/CMFDefault/DiscussionTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFDefault/DiscussionTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -21,9 +21,7 @@
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
-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 \
@@ -41,6 +39,7 @@
class DiscussionTool( UniqueObject, SimpleItem, ActionProviderBase ):
+
""" Links content to discussions.
"""
@@ -48,7 +47,6 @@
id = 'portal_discussion'
meta_type = 'Default Discussion Tool'
- _actions = ()
security = ClassSecurityInfo()
Modified: CMF/trunk/CMFDefault/MembershipTool.py
===================================================================
--- CMF/trunk/CMFDefault/MembershipTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFDefault/MembershipTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -22,9 +22,7 @@
from Globals import DTMLFile
from Globals import InitializeClass
-from Products.CMFCore.ActionInformation import ActionInformation as AI
from Products.CMFCore.ActionProviderBase import ActionProviderBase
-from Products.CMFCore.Expression import Expression
from Products.CMFCore.MembershipTool import MembershipTool as BaseTool
from Products.CMFCore.utils import _checkPermission
from Products.CMFCore.utils import _getAuthenticatedUser
@@ -52,14 +50,15 @@
class MembershipTool( BaseTool ):
+
""" Implement 'portal_membership' interface using "stock" policies.
"""
__implements__ = (IMembershipTool, ActionProviderBase.__implements__)
meta_type = 'Default Membership Tool'
- _actions = ()
membersfolder_id = 'Members'
+
security = ClassSecurityInfo()
#
Modified: CMF/trunk/CMFDefault/MetadataTool.py
===================================================================
--- CMF/trunk/CMFDefault/MetadataTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFDefault/MetadataTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -35,6 +35,7 @@
class MetadataElementPolicy( SimpleItem ):
+
"""
Represent a type-specific policy about a particular DCMI element.
"""
@@ -125,9 +126,11 @@
class ElementSpec( SimpleItem ):
+
"""
Represent all the tool knows about a single metadata element.
"""
+
security = ClassSecurityInfo()
#
@@ -205,7 +208,6 @@
id = 'portal_metadata'
meta_type = 'Default Metadata Tool'
- _actions = ()
#
# Default values.
@@ -520,7 +522,6 @@
# TODO: Call initial_values_hook, if present
-
security.declareProtected(View, 'validateMetadata')
def validateMetadata( self, content ):
"""
Modified: CMF/trunk/CMFDefault/PropertiesTool.py
===================================================================
--- CMF/trunk/CMFDefault/PropertiesTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFDefault/PropertiesTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -15,33 +15,32 @@
$Id$
"""
-from OFS.SimpleItem import SimpleItem
+from AccessControl import ClassSecurityInfo
from Acquisition import aq_inner, aq_parent
from Globals import InitializeClass, DTMLFile
-from AccessControl import ClassSecurityInfo
+from OFS.SimpleItem import SimpleItem
-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.utils import UniqueObject
from permissions import ManagePortal
from utils import _dtmldir
+
class PropertiesTool(UniqueObject, SimpleItem, ActionProviderBase):
__implements__ = (IPropertiesTool, ActionProviderBase.__implements__)
id = 'portal_properties'
meta_type = 'Default Properties Tool'
- _actions = ()
+
security = ClassSecurityInfo()
manage_options = ( ActionProviderBase.manage_options +
({ 'label' : 'Overview', 'action' : 'manage_overview' }
- ,
+ ,
) + SimpleItem.manage_options
)
@@ -70,5 +69,4 @@
def smtp_server(self):
return self.MailHost.smtp_host
-
InitializeClass(PropertiesTool)
Modified: CMF/trunk/CMFDefault/RegistrationTool.py
===================================================================
--- CMF/trunk/CMFDefault/RegistrationTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFDefault/RegistrationTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -20,13 +20,10 @@
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
-from Products.CMFCore.ActionInformation import ActionInformation
-from Products.CMFCore.Expression import Expression
from Products.CMFCore.RegistrationTool import RegistrationTool as BaseTool
from Products.CMFCore.utils import _checkPermission
from Products.CMFCore.utils import getToolByName
-from permissions import AddPortalMember
from permissions import ManagePortal
from utils import MessageID as _
@@ -39,7 +36,7 @@
__implements__ = BaseTool.__implements__
meta_type = 'Default Registration Tool'
- _actions = ()
+
security = ClassSecurityInfo()
#
Modified: CMF/trunk/CMFDefault/SyndicationTool.py
===================================================================
--- CMF/trunk/CMFDefault/SyndicationTool.py 2005-09-12 11:56:28 UTC (rev 38446)
+++ CMF/trunk/CMFDefault/SyndicationTool.py 2005-09-12 12:01:47 UTC (rev 38447)
@@ -24,9 +24,7 @@
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
-from Products.CMFCore.ActionInformation import ActionInformation
from Products.CMFCore.ActionProviderBase import ActionProviderBase
-from Products.CMFCore.Expression import Expression
from Products.CMFCore.PortalFolder import PortalFolderBase
from Products.CMFCore.utils import _checkPermission
from Products.CMFCore.utils import UniqueObject
@@ -38,7 +36,8 @@
from utils import _dtmldir
-class SyndicationTool (UniqueObject, SimpleItem, ActionProviderBase):
+class SyndicationTool(UniqueObject, SimpleItem, ActionProviderBase):
+
"""
The syndication tool manages the site-wide policy for
syndication of folder content as RSS.
@@ -48,7 +47,7 @@
id = 'portal_syndication'
meta_type = 'Default Syndication Tool'
- _actions = ()
+
security = ClassSecurityInfo()
#Default Sitewide Values
More information about the CMF-checkins
mailing list