[uicfg reloading] don't reload uicfg when appobjects modules won't be reloaded as well
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 03 Aug 2009 16:32:30 +0200
changeset 2662 87aed8cb7ff6
parent 2661 f8df42c9da6b
child 2663 2bb628e0cc3b
[uicfg reloading] don't reload uicfg when appobjects modules won't be reloaded as well
vregistry.py
--- a/vregistry.py	Mon Aug 03 16:31:30 2009 +0200
+++ b/vregistry.py	Mon Aug 03 16:32:30 2009 +0200
@@ -213,11 +213,15 @@
         super(VRegistry, self).__init__()
         self.config = config
 
-    def reset(self):
+    def reset(self, force_reload=None):
         self.clear()
         self._lastmodifs = {}
+        # don't reload uicfg when appobjects modules won't be reloaded as well
         if uicfg is not None:
-            reload(uicfg)
+            if force_reload is None:
+                force_reload = self.config.mode == 'dev'
+            if force_reload:
+                reload(uicfg)
 
     def __getitem__(self, name):
         """return the registry (dictionary of class objects) associated to