* print vreg content once fully initialized (require move of print code from vregistry to cwvreg) tls-sprint
authorsylvain.thenault@logilab.fr
Wed, 08 Apr 2009 11:29:28 +0200
branchtls-sprint
changeset 1282 272d8ec6f308
parent 1277 2eeef019e186
child 1283 d812bd08c11c
* print vreg content once fully initialized (require move of print code from vregistry to cwvreg) * new vreg_initialization_completed callback on appobjects, called once the vregistry is fully initialized
appobject.py
cwvreg.py
vregistry.py
--- a/appobject.py	Tue Apr 07 19:55:38 2009 +0200
+++ b/appobject.py	Wed Apr 08 11:29:28 2009 +0200
@@ -62,7 +62,11 @@
         cls.config = vreg.config
         cls.register_properties()
         return cls
-
+    
+    @classmethod
+    def vreg_initialization_completed(cls):
+        pass
+    
     @classmethod
     def selected(cls, *args, **kwargs):
         """by default web app objects are usually instantiated on
--- a/cwvreg.py	Tue Apr 07 19:55:38 2009 +0200
+++ b/cwvreg.py	Wed Apr 08 11:29:28 2009 +0200
@@ -140,6 +140,13 @@
             # clear needs_iface so we don't try to remove some not-anymore-in
             # objects on automatic reloading
             self._needs_iface.clear()
+            # print registry content
+            for registry, objects in self.items():
+                self.debug('available in registry %s: %s', registry,
+                           sorted(objects))
+                for appobjects in objects.itervalues():
+                    for appobject in appobjects:
+                        appobject.vreg_initialization_completed()
     
     @cached
     def etype_class(self, etype):
--- a/vregistry.py	Tue Apr 07 19:55:38 2009 +0200
+++ b/vregistry.py	Wed Apr 08 11:29:28 2009 +0200
@@ -363,10 +363,6 @@
                 directory, filename = split(fileordirectory)
                 if self.load_file(directory, filename, force_reload):
                     change = True
-        if change:
-            for registry, objects in self.items():
-                self.debug('available in registry %s: %s', registry,
-                           sorted(objects))
         return change
     
     def read_directory(self, directory, force_reload=False):