[CMF-checkins] CVS: Products/CMFCore - ActionsTool.py:1.49
ContentTypeRegistry.py:1.16 FSPythonScript.py:1.26
MemberDataTool.py:1.35 PortalFolder.py:1.64
WorkflowCore.py:1.14 utils.py:1.56
Yvo Schubbe
y.2004_ at wcm-solutions.de
Tue Jul 13 12:50:09 EDT 2004
Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv28316/CMFCore
Modified Files:
ActionsTool.py ContentTypeRegistry.py FSPythonScript.py
MemberDataTool.py PortalFolder.py WorkflowCore.py utils.py
Log Message:
- some import and whitespace cleanup
=== Products/CMFCore/ActionsTool.py 1.48 => 1.49 ===
--- Products/CMFCore/ActionsTool.py:1.48 Thu Apr 29 12:13:16 2004
+++ Products/CMFCore/ActionsTool.py Tue Jul 13 12:49:39 2004
@@ -15,7 +15,6 @@
$Id$
"""
-from types import DictionaryType
from warnings import warn
from AccessControl import ClassSecurityInfo
@@ -23,17 +22,15 @@
from Globals import DTMLFile
from Globals import InitializeClass
from OFS.Folder import Folder
-from OFS.SimpleItem import SimpleItem
from ActionInformation import ActionInformation
from ActionInformation import getOAI
from ActionProviderBase import ActionProviderBase
-from permissions import ListFolderContents
-from permissions import ManagePortal
from Expression import Expression
from Expression import getExprContext
from interfaces.portal_actions import portal_actions as IActionsTool
-from TypesTool import TypeInformation
+from permissions import ListFolderContents
+from permissions import ManagePortal
from utils import _checkPermission
from utils import _dtmldir
from utils import SimpleItemWithProperties
@@ -210,7 +207,7 @@
actions = provider.listActions(info)
action_infos = []
- if actions and type(actions[0]) is not DictionaryType:
+ if actions and not isinstance(actions[0], dict):
ec = getExprContext(self, object)
for ai in actions:
if not ai.getVisibility():
=== Products/CMFCore/ContentTypeRegistry.py 1.15 => 1.16 ===
--- Products/CMFCore/ContentTypeRegistry.py:1.15 Thu Apr 29 12:13:16 2004
+++ Products/CMFCore/ContentTypeRegistry.py Tue Jul 13 12:49:39 2004
@@ -15,20 +15,22 @@
$Id$
"""
-from OFS.SimpleItem import SimpleItem, Item
+import re, os, urllib
+
from AccessControl import ClassSecurityInfo
-from Globals import DTMLFile, InitializeClass, PersistentMapping
+from Globals import DTMLFile
+from Globals import InitializeClass
+from Globals import PersistentMapping
+from OFS.SimpleItem import SimpleItem
from ZPublisher.mapply import mapply
-from permissions import ManagePortal
-from utils import _dtmldir, getToolByName
-
-import re, os, urllib
-
-from interfaces.ContentTypeRegistry \
- import ContentTypeRegistryPredicate as IContentTypeRegistryPredicate
from interfaces.ContentTypeRegistry \
import ContentTypeRegistry as IContentTypeRegistry
+from interfaces.ContentTypeRegistry \
+ import ContentTypeRegistryPredicate as IContentTypeRegistryPredicate
+from permissions import ManagePortal
+from utils import _dtmldir
+from utils import getToolByName
class MajorMinorPredicate( SimpleItem ):
@@ -135,7 +137,7 @@
security.declareProtected( ManagePortal, 'getExtensions' )
def getExtensions(self):
- """ Get filename extensions.
+ """ Get filename extensions.
"""
if self.extensions is None:
return 'None'
@@ -280,7 +282,7 @@
"""
if self.pattern is None:
return 0
-
+
return self.pattern.match( name )
security.declareProtected( ManagePortal, 'getTypeLabel' )
@@ -344,7 +346,7 @@
"""
"""
return map( lambda x: x[0], _predicate_types )
-
+
security.declareProtected( ManagePortal, 'manage_predicates' )
manage_predicates = DTMLFile( 'registryPredList', _dtmldir )
@@ -450,7 +452,7 @@
"""
Return a sequence of tuples,
'( id, ( predicate, typeObjectName ) )'
- for all predicates in the registry
+ for all predicates in the registry
"""
result = []
for predicate_id in self.predicate_ids:
=== Products/CMFCore/FSPythonScript.py 1.25 => 1.26 ===
--- Products/CMFCore/FSPythonScript.py:1.25 Thu Apr 29 12:13:16 2004
+++ Products/CMFCore/FSPythonScript.py Tue Jul 13 12:49:39 2004
@@ -15,22 +15,23 @@
$Id$
"""
-from os import path, stat
import new
-import Globals
-from AccessControl import ClassSecurityInfo, getSecurityManager
+from AccessControl import ClassSecurityInfo
+from AccessControl import getSecurityManager
+from ComputedAttribute import ComputedAttribute
+from Globals import DTMLFile
+from Globals import InitializeClass
from OFS.Cache import Cacheable
from Products.PythonScripts.PythonScript import PythonScript
from Shared.DC.Scripts.Script import Script
-from ComputedAttribute import ComputedAttribute
-from permissions import FTPAccess
-from permissions import View
-from permissions import ViewManagementScreens
from DirectoryView import registerFileExtension
from DirectoryView import registerMetaType
from FSObject import FSObject
+from permissions import FTPAccess
+from permissions import View
+from permissions import ViewManagementScreens
from utils import _dtmldir
from utils import expandpath
@@ -72,7 +73,7 @@
'ZBindingsHTML_editAction')
security.declareProtected(ViewManagementScreens, 'manage_main')
- manage_main = Globals.DTMLFile('custpy', _dtmldir)
+ manage_main = DTMLFile('custpy', _dtmldir)
def _createZODBClone(self):
"""Create a ZODB (editable) equivalent of this object."""
@@ -273,7 +274,7 @@
self._updateFromFS()
return self._bind_names
-Globals.InitializeClass(FSPythonScript)
+InitializeClass(FSPythonScript)
class FSPythonScriptTracebackSupplement:
=== Products/CMFCore/MemberDataTool.py 1.34 => 1.35 ===
--- Products/CMFCore/MemberDataTool.py:1.34 Wed May 5 10:18:23 2004
+++ Products/CMFCore/MemberDataTool.py Tue Jul 13 12:49:39 2004
@@ -16,7 +16,6 @@
"""
from AccessControl import ClassSecurityInfo
-from AccessControl.Role import RoleManager
from Acquisition import aq_inner, aq_parent, aq_base
from BTrees.OOBTree import OOBTree
from Globals import DTMLFile
=== Products/CMFCore/PortalFolder.py 1.63 => 1.64 ===
--- Products/CMFCore/PortalFolder.py:1.63 Tue Jun 1 11:56:13 2004
+++ Products/CMFCore/PortalFolder.py Tue Jul 13 12:49:39 2004
@@ -26,9 +26,9 @@
from Globals import DTMLFile
from Globals import InitializeClass
from OFS.OrderedFolder import OrderedFolder
-from OFS.ObjectManager import REPLACEABLE
from CMFCatalogAware import CMFCatalogAware
+from DynamicType import DynamicType
from exceptions import AccessControl_Unauthorized
from exceptions import zExceptions_Unauthorized
from permissions import AddPortalContent
@@ -38,7 +38,6 @@
from permissions import ManagePortal
from permissions import ManageProperties
from permissions import View
-from DynamicType import DynamicType
from utils import _checkPermission
from utils import getToolByName
=== Products/CMFCore/WorkflowCore.py 1.13 => 1.14 ===
--- Products/CMFCore/WorkflowCore.py:1.13 Fri Nov 28 09:52:00 2003
+++ Products/CMFCore/WorkflowCore.py Tue Jul 13 12:49:39 2004
@@ -14,8 +14,6 @@
$Id$
"""
-import sys
-
from Acquisition import aq_base
from MethodObject import Method
=== Products/CMFCore/utils.py 1.55 => 1.56 ===
--- Products/CMFCore/utils.py:1.55 Wed May 26 15:05:34 2004
+++ Products/CMFCore/utils.py Tue Jul 13 12:49:39 2004
@@ -15,12 +15,9 @@
$Id$
"""
-import os
from os import path as os_path
from os.path import abspath
import re
-from types import StringType
-from types import UnicodeType
from warnings import warn
from AccessControl import ClassSecurityInfo
@@ -124,7 +121,7 @@
"""
# this code is ported from ZopeSecurityPolicy.checkPermission
roles = rolesForPermissionOn(permission, obj)
- if type(roles) in (StringType, UnicodeType):
+ if isinstance(roles, basestring):
roles = [roles]
context = getSecurityManager()._context
@@ -298,8 +295,7 @@
perm_info = _ac_inherited_permissions(ob, 1)
for name, settings in map.items():
cur_roles = rolesForPermissionOn(name, ob)
- t = type(cur_roles)
- if t is StringType:
+ if isinstance(cur_roles, basestring):
cur_roles = [cur_roles]
else:
cur_roles = list(cur_roles)
More information about the CMF-checkins
mailing list