From 669e6e513cb574739a9879bd9a298bf248d79bec Mon Sep 17 00:00:00 2001
From: Nicolas Dumazet <nicolas.dumazet@nexedi.com>
Date: Thu, 4 Nov 2010 05:58:21 +0000
Subject: [PATCH] code simplification

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39873 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Utils.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/product/ERP5Type/Utils.py b/product/ERP5Type/Utils.py
index 1c6d06fb23..472554bf48 100644
--- a/product/ERP5Type/Utils.py
+++ b/product/ERP5Type/Utils.py
@@ -444,15 +444,14 @@ def updateGlobals(this_module, global_hook,
     # 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)
 
-- 
2.30.9