[CMF-checkins] CVS: CMF/CMFDefault - DublinCore.py:1.28
Portal.py:1.37 SkinnedFolder.py:1.16 SyndicationTool.py:1.20
Yvo Schubbe
cvs-admin at zope.org
Mon Dec 1 08:56:14 EST 2003
Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv16302/CMFDefault
Modified Files:
DublinCore.py Portal.py SkinnedFolder.py SyndicationTool.py
Log Message:
some code modernization:
- death to string module
- death to apply
- import and whitespace cleanup
=== CMF/CMFDefault/DublinCore.py 1.27 => 1.28 ===
--- CMF/CMFDefault/DublinCore.py:1.27 Thu Apr 24 17:18:02 2003
+++ CMF/CMFDefault/DublinCore.py Mon Dec 1 08:55:43 2003
@@ -10,23 +10,29 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
+""" Dublin Core support for content types.
-import string, re
-from OFS.PropertyManager import PropertyManager
-from DateTime.DateTime import DateTime
+$Id$
+"""
+
+from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
-from Products.CMFCore.WorkflowCore import WorkflowAction
-from Products.CMFCore.interfaces.DublinCore import DublinCore
+from DateTime.DateTime import DateTime
+from Globals import DTMLFile
+from Globals import InitializeClass
+from OFS.PropertyManager import PropertyManager
+
+from Products.CMFCore.CMFCorePermissions import ModifyPortalContent
from Products.CMFCore.interfaces.DublinCore import CatalogableDublinCore
+from Products.CMFCore.interfaces.DublinCore import DublinCore
from Products.CMFCore.interfaces.DublinCore import MutableDublinCore
+from Products.CMFCore.WorkflowCore import WorkflowAction
from utils import tuplize, _dtmldir, semi_split
-from Globals import InitializeClass, DTMLFile
-from AccessControl import ClassSecurityInfo
-from Products.CMFCore.CMFCorePermissions import ModifyPortalContent
_marker=[]
+
class DefaultDublinCoreImpl( PropertyManager ):
"""
Mix-in class which provides Dublin Core methods
@@ -284,11 +290,10 @@
"""
hdrlist = []
hdrlist.append( ( 'Title', self.Title() ) )
- hdrlist.append( ( 'Subject', string.join( self.Subject(), ', ' ) ) )
+ hdrlist.append( ( 'Subject', ', '.join( self.Subject() ) ) )
hdrlist.append( ( 'Publisher', self.Publisher() ) )
hdrlist.append( ( 'Description', self.Description() ) )
- hdrlist.append( ( 'Contributors', string.join(
- self.Contributors(), '; ' ) ) )
+ hdrlist.append( ( 'Contributors', '; '.join( self.Contributors() ) ) )
hdrlist.append( ( 'Effective_date', self.EffectiveDate() ) )
hdrlist.append( ( 'Expiration_date', self.ExpirationDate() ) )
hdrlist.append( ( 'Type', self.Type() ) )
@@ -450,7 +455,7 @@
# locking interface, and fail gracefully if they dont
if hasattr(self, 'failIfLocked'):
self.failIfLocked()
-
+
self._editMetadata(title=title
, subject=subject
, description=description
=== CMF/CMFDefault/Portal.py 1.36 => 1.37 ===
--- CMF/CMFDefault/Portal.py:1.36 Mon Sep 1 11:18:36 2003
+++ CMF/CMFDefault/Portal.py Mon Dec 1 08:55:43 2003
@@ -257,9 +257,9 @@
if tool is None:
return
for t in initial_types:
- cfm = apply(ContentFactoryMetadata, (), t)
+ cfm = ContentFactoryMetadata(**t)
tool._setObject(t['id'], cfm)
-
+
def setupMimetypes(self, p):
p.manage_addProduct[ 'CMFCore' ].manage_addRegistry()
reg = p.content_type_registry
=== CMF/CMFDefault/SkinnedFolder.py 1.15 => 1.16 ===
--- CMF/CMFDefault/SkinnedFolder.py:1.15 Sat Jun 28 12:31:21 2003
+++ CMF/CMFDefault/SkinnedFolder.py Mon Dec 1 08:55:43 2003
@@ -15,15 +15,16 @@
$Id$
"""
-from Products.CMFCore.PortalFolder import PortalFolder
-from Products.CMFCore.CMFCorePermissions import View
-from Products.CMFCore.CMFCorePermissions import ManageProperties
-from Products.CMFCore.CMFCorePermissions import ListFolderContents
from AccessControl import ClassSecurityInfo
+from Acquisition import aq_base
from Globals import InitializeClass
-from Products.CMFCore.utils import _getViewFor
+
from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
-from Acquisition import aq_base
+from Products.CMFCore.CMFCorePermissions import ListFolderContents
+from Products.CMFCore.CMFCorePermissions import ManageProperties
+from Products.CMFCore.CMFCorePermissions import View
+from Products.CMFCore.PortalFolder import PortalFolder
+from Products.CMFCore.utils import _getViewFor
factory_type_information = (
{ 'id' : 'Skinned Folder'
@@ -38,7 +39,7 @@
, 'immediate_view' : 'folder_edit_form'
, 'aliases' : {'(Default)':'folder_view',
'view':'folder_view'}
- , 'actions' : ( { 'id' : 'view'
+ , 'actions' : ( { 'id' : 'view'
, 'name' : 'View'
, 'action': 'string:${object_url}/folder_view'
, 'permissions' : (View,)
@@ -77,7 +78,7 @@
'''
view = _getViewFor(self)
if getattr(aq_base(view), 'isDocTemp', 0):
- return apply(view, (self, self.REQUEST))
+ return view(self, self.REQUEST)
else:
return view()
=== CMF/CMFDefault/SyndicationTool.py 1.19 => 1.20 ===
--- CMF/CMFDefault/SyndicationTool.py:1.19 Sun Nov 23 11:29:04 2003
+++ CMF/CMFDefault/SyndicationTool.py Mon Dec 1 08:55:43 2003
@@ -13,29 +13,30 @@
""" CMFDefault portal_syndication tool.
Manage outbound RSS syndication of folder content.
-"""
-import os
+$Id$
+"""
-from Globals import HTMLFile, package_home, InitializeClass
-from AccessControl import ClassSecurityInfo, SecurityManagement
-from Acquisition import aq_base, aq_inner, aq_parent
+from AccessControl import ClassSecurityInfo
+from Acquisition import aq_base
from DateTime import DateTime
+from Globals import HTMLFile
+from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
-from Products.CMFCore.utils import UniqueObject
-from Products.CMFCore.utils import _checkPermission
+from Products.CMFCore.ActionInformation import ActionInformation
+from Products.CMFCore.ActionProviderBase import ActionProviderBase
+from Products.CMFCore.CMFCorePermissions import AccessContentsInformation
from Products.CMFCore.CMFCorePermissions import ManagePortal
from Products.CMFCore.CMFCorePermissions import ManageProperties
-from Products.CMFCore.CMFCorePermissions import AccessContentsInformation
-from Products.CMFCore.ActionProviderBase import ActionProviderBase
-from Products.CMFCore.ActionInformation import ActionInformation
from Products.CMFCore.Expression import Expression
from Products.CMFCore.PortalFolder import PortalFolder
+from Products.CMFCore.utils import _checkPermission
+from Products.CMFCore.utils import UniqueObject
from SyndicationInfo import SyndicationInformation
+from utils import _dtmldir
-_dtmldir = os.path.join( package_home( globals() ), 'dtml' )
class SyndicationTool (UniqueObject, SimpleItem, ActionProviderBase):
"""
@@ -53,7 +54,7 @@
, action=Expression(
text='string:${folder_url}/synPropertiesForm')
, condition=Expression(
- text='python: folder is object')
+ text='python: folder is object')
, permissions=(ManageProperties,)
, category='folder'
, visible=1
@@ -69,7 +70,7 @@
max_items = 15
security = ClassSecurityInfo()
-
+
#ZMI Methods
manage_options = ( ActionProviderBase.manage_options
+ ( { 'label' : 'Overview'
@@ -106,7 +107,7 @@
security.declareProtected(ManagePortal, 'reportForm')
reportForm = HTMLFile('synReports', _dtmldir)
-
+
security.declareProtected(ManagePortal, 'editProperties')
def editProperties( self
, updatePeriod=None
@@ -331,13 +332,13 @@
return syInfo.syUpdateFrequency
else:
return 'Syndication is not Allowed'
-
+
security.declarePublic('getUpdateBase')
def getUpdateBase(self, obj=None):
"""
Return the base date to be used with the update frequency
and the update period to calculate a publishing schedule.
-
+
Note: I'm not sure what's best here, creation date, last
modified date (of the folder being syndicated) or some
arbitrary date. For now, I'm going to build a updateBase
More information about the CMF-checkins
mailing list