cwvreg.py
branchstable
changeset 2906 677fa98659a8
parent 2761 7c583d02917b
child 2914 03fe782c6500
equal deleted inserted replaced
2905:b23bbb31368c 2906:677fa98659a8
   226         if initlog:
   226         if initlog:
   227             # first init log service
   227             # first init log service
   228             config.init_log(debug=debug)
   228             config.init_log(debug=debug)
   229         super(CubicWebVRegistry, self).__init__(config)
   229         super(CubicWebVRegistry, self).__init__(config)
   230         self.schema = None
   230         self.schema = None
       
   231         self.initialized = False
   231         self.reset()
   232         self.reset()
   232         self.initialized = False
       
   233 
   233 
   234     def setdefault(self, regid):
   234     def setdefault(self, regid):
   235         try:
   235         try:
   236             return self[regid]
   236             return self[regid]
   237         except RegistryNotFound:
   237         except RegistryNotFound:
   254         super(CubicWebVRegistry, self).reset(path, force_reload)
   254         super(CubicWebVRegistry, self).reset(path, force_reload)
   255         self._needs_iface = {}
   255         self._needs_iface = {}
   256         # two special registries, propertydefs which care all the property
   256         # two special registries, propertydefs which care all the property
   257         # definitions, and propertyvals which contains values for those
   257         # definitions, and propertyvals which contains values for those
   258         # properties
   258         # properties
   259         self['propertydefs'] = {}
   259         if not self.initialized:
   260         self['propertyvalues'] = self.eprop_values = {}
   260             self['propertydefs'] = {}
   261         for key, propdef in self.config.eproperty_definitions():
   261             self['propertyvalues'] = self.eprop_values = {}
   262             self.register_property(key, **propdef)
   262             for key, propdef in self.config.eproperty_definitions():
       
   263                 self.register_property(key, **propdef)
   263         if path is not None and force_reload:
   264         if path is not None and force_reload:
   264             cleanup_sys_modules(path)
   265             cleanup_sys_modules(path)
   265             cubes = self.config.cubes()
   266             cubes = self.config.cubes()
   266             # if the fs code use some cubes not yet registered into the instance
   267             # if the fs code use some cubes not yet registered into the instance
   267             # we should cleanup sys.modules for those as well to avoid potential
   268             # we should cleanup sys.modules for those as well to avoid potential