[Erp5-report] r39873 nicolas.dumazet - /erp5/trunk/products/ERP5Type/Utils.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Nov 4 06:58:23 CET 2010


Author: nicolas.dumazet
Date: Thu Nov  4 06:58:21 2010
New Revision: 39873

URL: http://svn.erp5.org?rev=39873&view=rev
Log:
code simplification

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

Modified: erp5/trunk/products/ERP5Type/Utils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Utils.py?rev=39873&r1=39872&r2=39873&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Utils.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Utils.py [utf8] Thu Nov  4 06:58:21 2010
@@ -444,15 +444,14 @@ def updateGlobals(this_module, global_ho
     # Add _dtmldir
     this_module._dtmldir = os.path.join( product_path, 'dtml' )
 
+    module_list = (
+        ('PropertySheet', importLocalPropertySheet),
+        ('interfaces', importLocalInterface),
+        ('Constraint', importLocalConstraint),
+    )
     # Update PropertySheet Registry
-    for module_id in ('PropertySheet', 'interfaces', 'Constraint'):
+    for module_id, import_method in module_list:
       path, module_id_list = getModuleIdList(product_path, module_id)
-      if module_id == 'PropertySheet':
-        import_method = importLocalPropertySheet
-      elif module_id == 'interfaces':
-        import_method = importLocalInterface
-      elif module_id == 'Constraint':
-        import_method = importLocalConstraint
       for module_id in module_id_list:
         import_method(module_id, path=path)
 




More information about the Erp5-report mailing list