vregistry.py
branchtls-sprint
changeset 1316 6d71d38822ee
parent 1310 99dfced5673e
child 1432 2c3711d4570b
--- a/vregistry.py	Thu Apr 09 12:55:00 2009 +0200
+++ b/vregistry.py	Thu Apr 09 13:51:01 2009 +0200
@@ -351,6 +351,12 @@
     
     # intialization methods ###################################################
     
+    def init_registration(self, path):
+        # compute list of all modules that have to be loaded
+        self._toloadmods, filemods = _toload_info(path)
+        self._loadedmods = {}
+        return filemods
+    
     def register_objects(self, path, force_reload=None):
         if force_reload is None:
             force_reload = self.config.mode == 'dev'
@@ -370,16 +376,14 @@
                 sys.path.remove(webdir)
         if CW_SOFTWARE_ROOT in sys.path:
             sys.path.remove(CW_SOFTWARE_ROOT)
-        # compute list of all modules that have to be loaded
-        self._toloadmods, filemods = _toload_info(path)
-        self._loadedmods = {}
         # load views from each directory in the application's path
+        filemods = self.init_registration(path)
         change = False
         for filepath, modname in filemods:
             if self.load_file(filepath, modname, force_reload):
                 change = True
         return change
-
+    
     def load_file(self, filepath, modname, force_reload=False):
         """load visual objects from a python file"""
         from logilab.common.modutils import load_module_from_name