[events] renamed source-reload into registry-reload to avoid potential confusions with datasources
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 05 Aug 2009 18:18:12 +0200
changeset 2705 30bcdbd92820
parent 2704 09516a696636
child 2706 09baf5175196
[events] renamed source-reload into registry-reload to avoid potential confusions with datasources
__init__.py
cwvreg.py
etwist/server.py
web/application.py
web/uicfg.py
--- a/__init__.py	Wed Aug 05 17:33:40 2009 +0200
+++ b/__init__.py	Wed Aug 05 18:18:12 2009 +0200
@@ -324,12 +324,12 @@
     Typical usage to register a callback::
 
       >>> from cubicweb import CW_EVENT_MANAGER
-      >>> CW_EVENT_MANAGER.bind('after-source-reload', mycallback)
+      >>> CW_EVENT_MANAGER.bind('after-registry-reload', mycallback)
 
     Typical usage to emit an event::
 
       >>> from cubicweb import CW_EVENT_MANAGER
-      >>> CW_EVENT_MANAGER.emit('after-source-reload')
+      >>> CW_EVENT_MANAGER.emit('after-registry-reload')
 
     emit() accepts an additional context parameter that will be passed
     to the callback if specified (and only in that case)
@@ -353,7 +353,7 @@
     """decorator to ease event / callback binding
 
     >>> from cubicweb import onevent
-    >>> @onevent('before-source-reload')
+    >>> @onevent('before-registry-reload')
     ... def mycallback():
     ...     print 'hello'
     ...
--- a/cwvreg.py	Wed Aug 05 17:33:40 2009 +0200
+++ b/cwvreg.py	Wed Aug 05 18:18:12 2009 +0200
@@ -305,12 +305,12 @@
         try:
             self._register_objects(path, force_reload)
         except RegistryOutOfDate:
-            CW_EVENT_MANAGER.emit('before-source-reload')
+            CW_EVENT_MANAGER.emit('before-registry-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')
+            CW_EVENT_MANAGER.emit('after-registry-reload')
 
     def _register_objects(self, path, force_reload=None):
         """overriden to remove objects requiring a missing interface"""
--- a/etwist/server.py	Wed Aug 05 17:33:40 2009 +0200
+++ b/etwist/server.py	Wed Aug 05 18:18:12 2009 +0200
@@ -110,7 +110,7 @@
                 start_task(1, self.pyro_loop_event)
             self.appli.repo.start_looping_tasks()
         self.set_url_rewriter()
-        CW_EVENT_MANAGER.bind('after-source-reload', self.set_url_rewriter)
+        CW_EVENT_MANAGER.bind('after-registry-reload', self.set_url_rewriter)
         interval = min(config['cleanup-session-time'] or 120,
                        config['cleanup-anonymous-session-time'] or 720) / 2.
         start_task(interval, self.appli.session_handler.clean_sessions)
--- a/web/application.py	Wed Aug 05 17:33:40 2009 +0200
+++ b/web/application.py	Wed Aug 05 18:18:12 2009 +0200
@@ -42,7 +42,7 @@
             assert self.cleanup_session_time < self.session_time
             assert self.cleanup_anon_session_time < self.session_time
         self.set_authmanager()
-        CW_EVENT_MANAGER.bind('after-source-reload', self.set_authmanager)
+        CW_EVENT_MANAGER.bind('after-registry-reload', self.set_authmanager)
 
     def set_authmanager(self):
         self.authmanager = self.vreg['components'].select('authmanager')
@@ -244,7 +244,7 @@
         # instantiate session and url resolving helpers
         self.session_handler = session_handler_fact(self)
         self.set_urlresolver()
-        CW_EVENT_MANAGER.bind('after-source-reload', self.set_urlresolver)
+        CW_EVENT_MANAGER.bind('after-registry-reload', self.set_urlresolver)
 
     def set_urlresolver(self):
         self.url_resolver = self.vreg['components'].select('urlpublisher')
--- a/web/uicfg.py	Wed Aug 05 17:33:40 2009 +0200
+++ b/web/uicfg.py	Wed Aug 05 18:18:12 2009 +0200
@@ -217,7 +217,7 @@
 actionbox_appearsin_addmenu = RelationTagsBool('actionbox_appearsin_addmenu',
                                                init_actionbox_appearsin_addmenu)
 
-@onevent('before-source-reload')
+@onevent('before-registry-reload')
 def clear_rtag_objects():
     primaryview_section.clear()
     primaryview_display_ctrl.clear()