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, ()) |