# HG changeset patch # User Sylvain Thénault # Date 1380284124 -7200 # Node ID c8a5f7f43c03e7894c116b9800555224d67441ed # Parent bcbc92223b35e9aacd5906f889fd87c49fdd7d2f instrument cwvreg, so we may know what's being loaded by asking the registry store diff -r bcbc92223b35 -r c8a5f7f43c03 cwvreg.py --- 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