vregistry.py
branchstable
changeset 2173 7fae9300b9f9
parent 2078 362703bff3d4
child 2181 94ca417b9b07
child 2308 b478c3a8ad2a
equal deleted inserted replaced
2172:cf8f9180e63e 2173:7fae9300b9f9
   243         else:
   243         else:
   244             self.warning('can\'t remove %s, no id %s in the %s registry',
   244             self.warning('can\'t remove %s, no id %s in the %s registry',
   245                          removed_id, obj.id, registryname)
   245                          removed_id, obj.id, registryname)
   246 
   246 
   247     def register_and_replace(self, obj, replaced, registryname=None):
   247     def register_and_replace(self, obj, replaced, registryname=None):
       
   248         # XXXFIXME this is a duplication of unregister()
       
   249         # remove register_and_replace in favor of unregister + register
       
   250         # or simplify by calling unregister then register here
   248         if hasattr(replaced, 'classid'):
   251         if hasattr(replaced, 'classid'):
   249             replaced = replaced.classid()
   252             replaced = replaced.classid()
   250         registryname = registryname or obj.__registry__
   253         registryname = registryname or obj.__registry__
   251         registry = self.registry(registryname)
   254         registry = self.registry(registryname)
   252         registered_objs = registry.get(obj.id, ())
   255         registered_objs = registry.get(obj.id, ())