[Erp5-report] r42393 nicolas.dumazet - in /erp5/trunk/products/ERP5Type: Utils.py __init__.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 18 06:36:05 CET 2011


Author: nicolas.dumazet
Date: Tue Jan 18 06:36:05 2011
New Revision: 42393

URL: http://svn.erp5.org?rev=42393&view=rev
Log:
put dynamic module registration in initializeProduct to avoid depending
on any kind of initialization order

Modified:
    erp5/trunk/products/ERP5Type/Utils.py
    erp5/trunk/products/ERP5Type/__init__.py

Modified: erp5/trunk/products/ERP5Type/Utils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Utils.py?rev=42393&r1=42392&r2=42393&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Utils.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Utils.py [utf8] Tue Jan 18 06:36:05 2011
@@ -1102,6 +1102,15 @@ def initializeProduct( context,
   except:
     LOG("ERP5Type", BLATHER, "No help directory for %s" % product_name)
 
+  # create dynamic modules if they dont exist, this only ever happens
+  # once.
+  try:
+    import erp5.portal_type
+  except ImportError:
+    from dynamic.portal_type_class import initializeDynamicModules
+    initializeDynamicModules()
+    import erp5.portal_type
+
   # Tools initialization
   tools = portal_tools
   if len(tools) > 0:

Modified: erp5/trunk/products/ERP5Type/__init__.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/__init__.py?rev=42393&r1=42392&r2=42393&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/__init__.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/__init__.py [utf8] Tue Jan 18 06:36:05 2011
@@ -114,9 +114,6 @@ def initialize( context ):
                          content_constructors = content_constructors,
                          content_classes = content_classes)
 
-  from dynamic.portal_type_class import initializeDynamicModules
-  initializeDynamicModules()
-
   # Register our Workflow factories directly (if on CMF 2)
   Products.ERP5Type.Workflow.registerAllWorkflowFactories(context)
   # We should register local constraints at some point



More information about the Erp5-report mailing list