310 else: |
310 else: |
311 self.warning('can\'t remove %s, no id %s in the %s registry', |
311 self.warning('can\'t remove %s, no id %s in the %s registry', |
312 removed_id, obj.id, registryname) |
312 removed_id, obj.id, registryname) |
313 |
313 |
314 def register_and_replace(self, obj, replaced, registryname=None): |
314 def register_and_replace(self, obj, replaced, registryname=None): |
|
315 # XXXFIXME this is a duplication of unregister() |
|
316 # remove register_and_replace in favor of unregister + register |
|
317 # or simplify by calling unregister then register here |
315 if hasattr(replaced, 'classid'): |
318 if hasattr(replaced, 'classid'): |
316 replaced = replaced.classid() |
319 replaced = replaced.classid() |
317 registryname = registryname or obj.__registry__ |
320 registryname = registryname or obj.__registry__ |
318 registry = self.registry(registryname) |
321 registry = self.registry(registryname) |
319 registered_objs = registry.get(obj.id, ()) |
322 registered_objs = registry.get(obj.id, ()) |