vregistry.py
branchtls-sprint
changeset 707 21a59b468f1a
parent 698 7dfd03e9e810
child 714 39a2a6673171
equal deleted inserted replaced
706:8be68582abb0 707:21a59b468f1a
   254             if oid:
   254             if oid:
   255                 self.register(obj)
   255                 self.register(obj)
   256                 
   256                 
   257     def register(self, obj, registryname=None, oid=None, clear=False):
   257     def register(self, obj, registryname=None, oid=None, clear=False):
   258         """base method to add an object in the registry"""
   258         """base method to add an object in the registry"""
       
   259         assert not '__abstract__' in obj.__dict__
   259         registryname = registryname or obj.__registry__
   260         registryname = registryname or obj.__registry__
   260         oid = oid or obj.id
   261         oid = oid or obj.id
   261         registry = self._registries.setdefault(registryname, {})
   262         registry = self._registries.setdefault(registryname, {})
   262         if clear:
   263         if clear:
   263             vobjects = registry[oid] =  []
   264             vobjects = registry[oid] =  []