Module b.commands

Part of bzrlib

No module docstring
Line # Kind Name Docs
63 Function register_command Utility function to help register a command
112 Function builtin_command_names Return list of builtin command names.
117 Function plugin_command_names Undocumented
129 Function get_all_cmds Return canonical name and class for all registered commands.
135 Function get_cmd_object Return the canonical name and command class for a command.
185 Class Command Base class for commands.
536 Function parse_args Parse command line.
600 Function apply_coveraged Undocumented
616 Function apply_profiled Undocumented
639 Function apply_lsprofiled Undocumented
651 Function shlex_split_unicode Undocumented
656 Function get_alias Return an expanded alias, or None if no alias exists.
675 Function run_bzr Execute a command.
803 Function display_command Decorator that suppresses pipe/interrupt errors.
823 Function main Undocumented
842 Function run_bzr_catch_errors Undocumented
858 Function run_bzr_catch_user_errors Run bzr and report user errors, but let internal errors propagate.
875 Class HelpCommandIndex A index for bzr help that returns commands.
898 Class Provider Generic class to be overriden by plugins
910 Class ProvidersRegistry This registry exists to allow other providers to exist
93 Function _squish_command_name Undocumented
97 Function _unsquish_command_name Undocumented
101 Function _builtin_commands Undocumented
121 Function _get_cmd_dict Return name->class mapping for all commands.
147 Function _get_cmd_object Worker for get_cmd_object which raises KeyError rather than BzrCommandError.
557 Function _match_argform Undocumented
def register_command(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 _squish_command_name(cmd):
Undocumented
def _unsquish_command_name(cmd):
Undocumented
def _builtin_commands():
Undocumented
def builtin_command_names():
Return list of builtin command names.
def plugin_command_names():
Undocumented
def _get_cmd_dict(plugins_override=True):
Return name->class mapping for all commands.
def get_all_cmds(plugins_override=True):
Return canonical name and class for all registered commands.
def get_cmd_object(cmd_name, plugins_override=True):

Return the canonical name and command class for a command.

plugins_override
If true, plugin commands can override builtins.
def _get_cmd_object(cmd_name, plugins_override=True):
Worker for get_cmd_object which raises KeyError rather than BzrCommandError.
def parse_args(command, argv, alias_argv=None):
Parse command line.

Arguments and options are parsed at this level before being passed down to specific command handlers. This routine knows, from a lookup table, something about the available options, what optargs they take, and which commands will accept them.

def _match_argform(cmd, takes_args, args):
Undocumented
def apply_coveraged(dirname, the_callable, *args, **kwargs):
Undocumented
def apply_profiled(the_callable, *args, **kwargs):
Undocumented
def apply_lsprofiled(filename, the_callable, *args, **kwargs):
Undocumented
def shlex_split_unicode(unsplit):
Undocumented
def get_alias(cmd, config=None):

Return an expanded alias, or None if no alias exists.

cmd
Command to be checked for an alias.
config
Used to specify an alternative config to use, which is especially useful for testing. If it is unspecified, the global config will be used.
def run_bzr(argv):

Execute a command.

This is similar to main(), but without all the trappings for logging and error handling.

argv
The command-line arguments, without the program name from argv[0] These should already be decoded. All library/test code calling run_bzr should be passing valid strings (don't need decoding).

Returns a command status or raises an exception.

Special master options: these must come before the command because they control how the command is interpreted.

--no-plugins Do not load plugin modules at all
--no-aliases Do not allow aliases
--builtin Only use builtin commands. (Plugins are still allowed to change other behaviour.)
--profile Run under the Python hotshot profiler.
--lsprof Run under the Python lsprof profiler.
--coverage Generate line coverage report in the specified directory.
def display_command(func):
Decorator that suppresses pipe/interrupt errors.
def main(argv):
Undocumented
def run_bzr_catch_errors(argv):
Undocumented
def run_bzr_catch_user_errors(argv):
Run bzr and report user errors, but let internal errors propagate.

This is used for the test suite, and might be useful for other programs that want to wrap the commandline interface.

API Documentation for BzrLib, generated by pydoctor at 2008-06-25 00:00:15.