cwvreg.py
changeset 9367 c8a5f7f43c03
parent 9258 4e79f587c6ab
child 9469 032825bbacab
child 9701 46c8d8701240
child 9768 afcd46716d6a
--- a/cwvreg.py	Tue Jan 07 16:19:18 2014 +0100
+++ b/cwvreg.py	Fri Sep 27 14:15:24 2013 +0200
@@ -615,6 +615,15 @@
         self.register_objects(path)
         CW_EVENT_MANAGER.emit('after-registry-reload')
 
+    def load_file(self, filepath, modname):
+        # override to allow some instrumentation (eg localperms)
+        modpath = modname.split('.')
+        try:
+            self.currently_loading_cube = modpath[modpath.index('cubes') + 1]
+        except ValueError:
+            self.currently_loading_cube = 'cubicweb'
+        return super(CWRegistryStore, self).load_file(filepath, modname)
+
     def _set_schema(self, schema):
         """set instance'schema"""
         self.schema = schema