b.c.CommandRegistry(registry.Registry) : class documentation

Part of bzrlib.commands View In Hierarchy

Special registry mapping command names to command classes.
Instance Variablesoverridden_registryLook in this registry for commands being overridden by this registry. This can be used to tell plugin commands about the builtin they're decorating.
Method __init__ Create a new Registry.
Method get Return the object register()'ed to the given key.
Method register Utility function to help register a command
Method register_lazy Register a command without loading its module.
Static Method _get_name Undocumented

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 remove Remove a registered entry.
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
def __init__(self):
Create a new Registry.
def get(self, command_name):
Return the object register()'ed to the given key.

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.

ParameterskeyThe 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.
ReturnsThe previously registered object.
RaisesImportErrorIf the object was registered lazily, and there are problems during import.
AttributeErrorIf registered lazily, and the module does not contain the registered member.
def _get_name(command_name):
def register(self, cmd, decorate=False):
Utility function to help register a command
ParameterscmdCommand subclass to register
decorateIf true, allow overriding an existing command of the same name; the old command is returned by this function. Otherwise it is an error to try to override an existing command.
def register_lazy(self, command_name, aliases, module_name):
Register a command without loading its module.
Parameterscommand_nameThe primary name of the command.
aliasesA list of aliases for the command.
Unknown Field: module_nameThe module that the command lives in.
API Documentation for Bazaar, generated by pydoctor at 2020-02-21 00:51:01.