cwvreg.py
changeset 2685 0518ca8f63e3
parent 2684 c84691380dd4
child 2705 30bcdbd92820
--- a/cwvreg.py	Tue Aug 04 18:43:55 2009 +0200
+++ b/cwvreg.py	Tue Aug 04 18:44:24 2009 +0200
@@ -16,7 +16,7 @@
 
 from cubicweb import (ETYPE_NAME_MAP, Binary, UnknownProperty, UnknownEid,
                       ObjectNotFound, NoSelectableObject, RegistryNotFound,
-                      RegistryOutOfDate)
+                      RegistryOutOfDate, CW_EVENT_MANAGER)
 from cubicweb.utils import dump_class
 from cubicweb.vregistry import VRegistry, Registry
 from cubicweb.rtags import RTAGS
@@ -305,10 +305,12 @@
         try:
             self._register_objects(path, force_reload)
         except RegistryOutOfDate:
+            CW_EVENT_MANAGER.emit('before-source-reload')
             # modification detected, reset and reload
             self.reset()
             cleanup_sys_modules(path)
             self._register_objects(path, force_reload)
+            CW_EVENT_MANAGER.emit('after-source-reload')
 
     def _register_objects(self, path, force_reload=None):
         """overriden to remove objects requiring a missing interface"""