Small cleanup (approved by jm)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29981 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e8fec41f
...@@ -974,20 +974,15 @@ def initializeProduct( context, ...@@ -974,20 +974,15 @@ def initializeProduct( context,
this_module, this_module,
global_hook, global_hook,
document_module=None, document_module=None,
document_classes=None, # XXX - Never used - must be likely removed document_classes=(), # XXX - Never used - must be likely removed
object_classes=None, object_classes=(),
portal_tools=None, portal_tools=(),
content_constructors=None, content_constructors=(),
content_classes=None): content_classes=()):
""" """
This function does all the initialization steps required This function does all the initialization steps required
for a Zope / CMF Product for a Zope / CMF Product
""" """
if document_classes is None: document_classes = []
if object_classes is None: object_classes = []
if portal_tools is None: portal_tools = []
if content_constructors is None: content_constructors = []
if content_classes is None: content_classes = []
product_name = this_module.__name__.split('.')[-1] product_name = this_module.__name__.split('.')[-1]
# Define content constructors for Document content classes (RAD) # Define content constructors for Document content classes (RAD)
...@@ -1069,19 +1064,12 @@ def initializeProduct( context, ...@@ -1069,19 +1064,12 @@ def initializeProduct( context,
# Register Objets # Register Objets
for c in object_classes: for c in object_classes:
if hasattr(c, 'icon'): icon = getattr(c, 'icon', None)
icon = getattr(c, 'icon') permission = getattr(c, 'permission_type', None)
else: context.registerClass(c,
icon = None constructors = c.constructors,
if hasattr(c, 'permission_type'): permission = permission,
context.registerClass( c, icon = icon)
constructors = c.constructors,
permission = c.permission_type,
icon = icon)
else:
context.registerClass( c,
constructors = c.constructors,
icon = icon)
class ConstraintNotFound(Exception): class ConstraintNotFound(Exception):
pass pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment