Part of bzrlib.registry View In Hierarchy
Known subclasses: bzrlib.controldir.ControlComponentFormatRegistry
Method | __init__ | Create a new Registry. |
Method | register | Register a new object to a name. |
Method | register_lazy | Register a new object to be loaded on request. |
Method | remove | Remove a registered entry. |
Method | get | Return the object register()'ed to the given key. |
Inherited from Registry:
Method | get_prefix | Return an object whose key is a prefix of the supplied value. |
Method | get_help | Get the help text associated with the given key |
Method | get_info | Get the extra information associated with the given key |
Method | __contains__ | Undocumented |
Method | keys | Get a list of registered entries |
Method | iteritems | Undocumented |
Method | items | Undocumented |
Method | _add_help_and_info | Add the help and information about this key |
Method | _get_module | Return the module the object will be or was loaded from. |
Method | _get_key_or_default | Return either 'key' or the default key if key is None |
Method | _set_default_key | Undocumented |
Method | _get_default_key | Undocumented |
Parameters | key | This is the key to use to request the object later. |
obj | The object to register. | |
help | Help text for this entry. This may be a string or a callable. If it is a callable, it should take two parameters (registry, key): this registry and the key that the help was registered under. | |
info | More information for this entry. Registry.get_info() can be used to get this information. Registry treats this as an opaque storage location (it is defined by the caller). | |
override_existing | Raise KeyErorr if False and something has already been registered for that key. If True, ignore if there is an existing key (always register the new value). |
Parameters | key | This is the key to use to request the object later. |
module_name | The python path to the module. Such as 'os.path'. | |
member_name | The member of the module to return. If empty or None, get() will return the module itself. | |
help | Help text for this entry. This may be a string or a callable. | |
info | More information for this entry. Registry.get_info() can be used to get this information. Registry treats this as an opaque storage location (it is defined by the caller). | |
override_existing | If True, replace the existing object with the new one. If False, if there is already something registered with the same key, raise a KeyError |
This is mostly for the test suite, but it can be used by others
May raise ImportError if the object was registered lazily and there are any problems, or AttributeError if the module does not have the supplied member.
Parameters | key | The key to obtain the object for. If no object has been registered to that key, the object registered for self.default_key will be returned instead, if it exists. Otherwise KeyError will be raised. |
Returns | The previously registered object. | |
Raises | ImportError | If the object was registered lazily, and there are problems during import. |
AttributeError | If registered lazily, and the module does not contain the registered member. |