[CMF-checkins] CVS: Products/CMFCore - TypesTool.py:1.88
Yvo Schubbe
y.2005- at wcm-solutions.de
Wed Apr 13 04:31:50 EDT 2005
Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv6527/CMFCore
Modified Files:
TypesTool.py
Log Message:
- made sure TypeInformation.__init__ just adds the id if no other keywords are provided
- made sure getMethodAliases returns a copy of the aliases dict
- some other cleanup
=== Products/CMFCore/TypesTool.py 1.87 => 1.88 ===
--- Products/CMFCore/TypesTool.py:1.87 Wed Apr 13 03:58:27 2005
+++ Products/CMFCore/TypesTool.py Wed Apr 13 04:31:49 2005
@@ -106,28 +106,29 @@
content_meta_type = ''
content_icon = ''
immediate_view = ''
- filter_content_types = 1
+ filter_content_types = True
allowed_content_types = ()
- allow_discussion = 0
- global_allow = 1
+ allow_discussion = False
+ global_allow = True
def __init__(self, id, **kw):
self.id = id
- kw = kw.copy() # Get a modifiable dict.
-
- if kw:
+ if not kw:
+ return
- if (not kw.has_key('content_meta_type')
- and kw.has_key('meta_type')):
- kw['content_meta_type'] = kw['meta_type']
+ kw = kw.copy() # Get a modifiable dict.
- if (not kw.has_key('content_icon')
- and kw.has_key('icon')):
- kw['content_icon'] = kw['icon']
+ if (not kw.has_key('content_meta_type')
+ and kw.has_key('meta_type')):
+ kw['content_meta_type'] = kw['meta_type']
+
+ if (not kw.has_key('content_icon')
+ and kw.has_key('icon')):
+ kw['content_icon'] = kw['icon']
- self.manage_changeProperties(**kw)
+ self.manage_changeProperties(**kw)
actions = kw.get( 'actions', () )
# make sure we have a copy
@@ -254,7 +255,7 @@
def listActions(self, info=None, object=None):
""" Return a sequence of the action info objects for this type.
"""
- if self._actions and type( self._actions[0] ) == type( {} ):
+ if self._actions and isinstance(self._actions[0], dict):
self._convertActions()
return self._actions or ()
@@ -330,7 +331,7 @@
if isinstance(method_id, tuple):
aliases[key] = method_id[0]
self._p_changed = True
- return aliases
+ return aliases.copy()
security.declareProtected(ManagePortal, 'setMethodAliases')
def setMethodAliases(self, aliases):
@@ -789,7 +790,7 @@
an object, rather than a string, attempt to look up
the appropriate type info using its portal_type.
"""
- if type( contentType ) is not type( '' ):
+ if not isinstance(contentType, basestring):
if hasattr(aq_base(contentType), 'getPortalTypeName'):
contentType = contentType.getPortalTypeName()
if contentType is None:
More information about the CMF-checkins
mailing list