cwvreg.py
changeset 2685 0518ca8f63e3
parent 2684 c84691380dd4
child 2705 30bcdbd92820
equal deleted inserted replaced
2684:c84691380dd4 2685:0518ca8f63e3
    14 
    14 
    15 from rql import RQLHelper
    15 from rql import RQLHelper
    16 
    16 
    17 from cubicweb import (ETYPE_NAME_MAP, Binary, UnknownProperty, UnknownEid,
    17 from cubicweb import (ETYPE_NAME_MAP, Binary, UnknownProperty, UnknownEid,
    18                       ObjectNotFound, NoSelectableObject, RegistryNotFound,
    18                       ObjectNotFound, NoSelectableObject, RegistryNotFound,
    19                       RegistryOutOfDate)
    19                       RegistryOutOfDate, CW_EVENT_MANAGER)
    20 from cubicweb.utils import dump_class
    20 from cubicweb.utils import dump_class
    21 from cubicweb.vregistry import VRegistry, Registry
    21 from cubicweb.vregistry import VRegistry, Registry
    22 from cubicweb.rtags import RTAGS
    22 from cubicweb.rtags import RTAGS
    23 
    23 
    24 
    24 
   303     def register_objects(self, path, force_reload=None):
   303     def register_objects(self, path, force_reload=None):
   304         """overriden to remove objects requiring a missing interface"""
   304         """overriden to remove objects requiring a missing interface"""
   305         try:
   305         try:
   306             self._register_objects(path, force_reload)
   306             self._register_objects(path, force_reload)
   307         except RegistryOutOfDate:
   307         except RegistryOutOfDate:
       
   308             CW_EVENT_MANAGER.emit('before-source-reload')
   308             # modification detected, reset and reload
   309             # modification detected, reset and reload
   309             self.reset()
   310             self.reset()
   310             cleanup_sys_modules(path)
   311             cleanup_sys_modules(path)
   311             self._register_objects(path, force_reload)
   312             self._register_objects(path, force_reload)
       
   313             CW_EVENT_MANAGER.emit('after-source-reload')
   312 
   314 
   313     def _register_objects(self, path, force_reload=None):
   315     def _register_objects(self, path, force_reload=None):
   314         """overriden to remove objects requiring a missing interface"""
   316         """overriden to remove objects requiring a missing interface"""
   315         extrapath = {}
   317         extrapath = {}
   316         for cubesdir in self.config.cubes_search_path():
   318         for cubesdir in self.config.cubes_search_path():