[i18ncube] clear_rtag_objects imported when generating cube's .po file stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 26 Mar 2010 13:20:42 +0100
branchstable
changeset 5035 8469d0acd949
parent 5034 4781870e97d9
child 5036 3e436a494ce3
[i18ncube] clear_rtag_objects imported when generating cube's .po file
cwvreg.py
--- a/cwvreg.py	Fri Mar 26 09:19:09 2010 +0100
+++ b/cwvreg.py	Fri Mar 26 13:20:42 2010 +0100
@@ -21,6 +21,9 @@
 from cubicweb.vregistry import VRegistry, Registry, class_regid
 from cubicweb.rtags import RTAGS
 
+def clear_rtag_objects():
+    for rtag in RTAGS:
+        rtag.clear()
 
 def use_interfaces(obj):
     """return interfaces used by the given object by searching for implements
@@ -262,10 +265,7 @@
         if self.config.mode != 'test':
             # don't clear rtags during test, this may cause breakage with
             # manually imported appobject modules
-            @onevent('before-registry-reload')
-            def clear_rtag_objects():
-                for rtag in RTAGS:
-                    rtag.clear()
+            CW_EVENT_MANAGER.bind('before-registry-reload', clear_rtag_objects)
 
     def setdefault(self, regid):
         try: