• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. RBTools 6.x
    2. Version 6.x
    3. Version 5.x
    4. Version 4.x
    5. Version 3.x
    6. Version 2.0
    7. Version 1.0
    8. Version 0.7
    9. Version 0.6
    10. Version 0.5
    11. RBTools Python API
    12. Module and Class References
    13. rbtools.commands.base.commands
  • Home
  • Installing RBTools
  • Authenticating to Review Board
  • rbt Command
  • Configuration
  • Creating Custom Command Aliases
  • Repository Configuration
  • Per-User Configuration
  • Azure DevOps / Team Foundation Server Configuration
  • Commands
  • alias
  • api-get
  • attach
  • clear-cache
  • close
  • diff
  • info
  • install
  • land
  • list-repo-types
  • login
  • logout
  • patch
  • post
  • publish
  • review
  • setup-completion
  • setup-repo
  • stamp
  • status
  • status-update
  • RBTools Workflows
  • Using RBTools with Git
  • Using RBTools With Perforce
  • Using RBTools with Jujutsu
  • Using RBTools with HCL ClearCase and IBM ClearCase
  • Using RBTools With Keysight SOS
  • RBTools Python API
  • Overview of the Python API Client
  • Common Use Cases
  • Module and Class References
  • rbtools
  • rbtools.deprecation
  • rbtools.api
  • rbtools.api.cache
  • rbtools.api.capabilities
  • rbtools.api.client
  • rbtools.api.decode
  • rbtools.api.decorators
  • rbtools.api.errors
  • rbtools.api.factory
  • rbtools.api.request
  • rbtools.api.transport
  • rbtools.api.transport.sync
  • rbtools.api.utils
  • rbtools.api.resource
  • rbtools.api.resource.base
  • rbtools.api.resource.base_archived_object
  • rbtools.api.resource.base_comment
  • rbtools.api.resource.base_diff_commit
  • rbtools.api.resource.base_review_group
  • rbtools.api.resource.base_review_request
  • rbtools.api.resource.base_review
  • rbtools.api.resource.base_user
  • rbtools.api.resource.mixins
  • rbtools.api.resource.api_token
  • rbtools.api.resource.archived_review_request
  • rbtools.api.resource.change
  • rbtools.api.resource.default_reviewer
  • rbtools.api.resource.diff_comment
  • rbtools.api.resource.diff_commit
  • rbtools.api.resource.diff_context
  • rbtools.api.resource.diff_file_attachment
  • rbtools.api.resource.diff
  • rbtools.api.resource.draft_diff_commit
  • rbtools.api.resource.draft_file_attachment
  • rbtools.api.resource.draft_screenshot
  • rbtools.api.resource.extension
  • rbtools.api.resource.file_attachment_comment
  • rbtools.api.resource.file_attachment
  • rbtools.api.resource.file_diff
  • rbtools.api.resource.general_comment
  • rbtools.api.resource.hosting_service_account
  • rbtools.api.resource.hosting_service
  • rbtools.api.resource.last_update
  • rbtools.api.resource.muted_review_request
  • rbtools.api.resource.oauth_application
  • rbtools.api.resource.oauth_token
  • rbtools.api.resource.plain_text
  • rbtools.api.resource.remote_repository
  • rbtools.api.resource.repository_branch
  • rbtools.api.resource.repository_commit
  • rbtools.api.resource.repository_group
  • rbtools.api.resource.repository_info
  • rbtools.api.resource.repository_user
  • rbtools.api.resource.repository
  • rbtools.api.resource.review_group_user
  • rbtools.api.resource.review_group
  • rbtools.api.resource.review_reply
  • rbtools.api.resource.review_request_draft
  • rbtools.api.resource.review_request
  • rbtools.api.resource.review
  • rbtools.api.resource.root
  • rbtools.api.resource.screenshot_comment
  • rbtools.api.resource.screenshot
  • rbtools.api.resource.search
  • rbtools.api.resource.server_info
  • rbtools.api.resource.session
  • rbtools.api.resource.status_update
  • rbtools.api.resource.user_file_attachment
  • rbtools.api.resource.user
  • rbtools.api.resource.validate_diff_commit
  • rbtools.api.resource.validate_diff
  • rbtools.api.resource.validation
  • rbtools.api.resource.watched_review_group
  • rbtools.api.resource.watched_review_request
  • rbtools.api.resource.watched
  • rbtools.api.resource.webhook
  • rbtools.clients
  • rbtools.clients.base
  • rbtools.clients.base.patch
  • rbtools.clients.base.registry
  • rbtools.clients.base.repository
  • rbtools.clients.base.scmclient
  • rbtools.clients.errors
  • rbtools.clients.bazaar
  • rbtools.clients.clearcase
  • rbtools.clients.cvs
  • rbtools.clients.git
  • rbtools.clients.mercurial
  • rbtools.clients.perforce
  • rbtools.clients.plastic
  • rbtools.clients.sos
  • rbtools.clients.svn
  • rbtools.clients.tfs
  • rbtools.config
  • rbtools.config.config
  • rbtools.config.loader
  • rbtools.diffs
  • rbtools.diffs.patches
  • rbtools.diffs.patcher
  • rbtools.diffs.tools
  • rbtools.diffs.tools.backends
  • rbtools.diffs.tools.backends.gnu
  • rbtools.diffs.tools.base
  • rbtools.diffs.tools.base.diff_file_result
  • rbtools.diffs.tools.base.diff_tool
  • rbtools.diffs.tools.errors
  • rbtools.diffs.tools.registry
  • rbtools.diffs.writers
  • rbtools.commands
  • rbtools.commands.main
  • rbtools.commands.base
  • rbtools.commands.base.commands
  • rbtools.commands.base.errors
  • rbtools.commands.base.options
  • rbtools.commands.base.output
  • rbtools.commands.alias
  • rbtools.commands.api_get
  • rbtools.commands.attach
  • rbtools.commands.clearcache
  • rbtools.commands.close
  • rbtools.commands.diff
  • rbtools.commands.info
  • rbtools.commands.install
  • rbtools.commands.land
  • rbtools.commands.list_repo_types
  • rbtools.commands.login
  • rbtools.commands.logout
  • rbtools.commands.patch
  • rbtools.commands.post
  • rbtools.commands.publish
  • rbtools.commands.review
  • rbtools.commands.setup_completion
  • rbtools.commands.setup_repo
  • rbtools.commands.stamp
  • rbtools.commands.status
  • rbtools.commands.status_update
  • rbtools.hooks
  • rbtools.hooks.common
  • rbtools.hooks.git
  • rbtools.testing
  • rbtools.testing.api
  • rbtools.testing.api.payloads
  • rbtools.testing.api.transport
  • rbtools.testing.commands
  • rbtools.testing.testcase
  • rbtools.testing.transport
  • rbtools.utils
  • rbtools.utils.aliases
  • rbtools.utils.browser
  • rbtools.utils.checks
  • rbtools.utils.commands
  • rbtools.utils.console
  • rbtools.utils.diffs
  • rbtools.utils.encoding
  • rbtools.utils.errors
  • rbtools.utils.filesystem
  • rbtools.utils.graphs
  • rbtools.utils.mimetypes
  • rbtools.utils.process
  • rbtools.utils.repository
  • rbtools.utils.review_request
  • rbtools.utils.source_tree
  • rbtools.utils.users
  • Glossary
  • General Index
  • Python Module Index
  • Release Notes
  • rbtools.commands.base.commands¶

    Base classes for commands.

    Added in version 5.0.

    Classes

    BaseCommand(transport_cls, stdout, stderr, stdin)

    Base class for RBTools commands.

    BaseMultiCommand(transport_cls, stdout, ...)

    Abstract base class for commands which offer subcommands.

    BaseSubCommand(options, config, *args, **kwargs)

    Abstract base class for a subcommand.

    LogLevelFilter(level)

    Filters log messages of a given level.

    SmartHelpFormatter(prog[, indent_increment, ...])

    Smartly formats help text, preserving paragraphs.

    class rbtools.commands.base.commands.BaseCommand(transport_cls: type[Transport] = <class 'rbtools.api.transport.sync.SyncTransport'>, stdout: TextIO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, stderr: TextIO = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, stdin: TextIO = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>)[source]¶

    Bases: object

    Base class for RBTools commands.

    This class will handle retrieving the configuration, and parsing command line options.

    usage is a list of usage strings each showing a use case. These should not include the main rbt command or the command name; they will be added automatically.

    Changed in version 5.0: This moved from rbtools.commands to rbtools.commands.base.commands.

    __firstlineno__ = 143¶
    __init__(transport_cls: type[Transport] = <class 'rbtools.api.transport.sync.SyncTransport'>, stdout: TextIO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, stderr: TextIO = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, stdin: TextIO = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>) → None[source]¶

    Initialize the base functionality for the command.

    Parameters:
    • transport_cls (rbtools.api.transport.Transport, optional) – The transport class used for all API communication. By default, this uses the transport defined in default_transport_cls.

    • stdout (io.TextIOWrapper, optional) –

      The standard output stream. This can be used to capture output programmatically.

      Added in version 3.1.

    • stderr (io.TextIOWrapper, optional) –

      The standard error stream. This can be used to capture errors programmatically.

      Added in version 3.1.

    • stdin (io.TextIOWrapper, optional) –

      The standard input stream. This can be used to provide input programmatically.

      Added in version 3.1.

    __static_attributes__ = ('api_client', 'api_root', 'capabilities', 'config', 'json', 'log', 'needs_api', 'needs_scm_client', 'options', 'repository', 'repository_info', 'server_url', 'stderr', 'stderr_bytes', 'stderr_is_atty', 'stdin', 'stdin_is_atty', 'stdout', 'stdout_bytes', 'stdout_is_atty', 'tool', 'transport_cls')¶
    api_client: RBClient | None¶

    The client used to connect to the API.

    This will be set when the command is run if needs_api is True. Otherwise it will be None.

    api_root: RootResource | None¶

    The root of the API tree.

    This will be set when the command is run if needs_api is True. Otherwise it will be None.

    args: ClassVar[str] = ''¶

    Usage text for what arguments the command takes.

    Arguments for the command are anything passed in other than defined options (for example, revisions passed to rbt post).

    Type:

    str

    author: ClassVar[str] = ''¶

    The author of the command.

    Type:

    str

    branch_options = <rbtools.commands.base.options.OptionGroup object>[source]¶
    capabilities: Capabilities | None¶

    Capabilities set by the API.

    This will be set when the command is run if needs_api is True. Otherwise it will be None.

    config: RBToolsConfig | None¶

    The loaded configuration for RBTools.

    Changed in version 5.0: This is now a RBToolsConfig instance, instead of a plain dictionary.

    create_arg_parser(argv: list[str], *, color: bool = True) → argparse.ArgumentParser[source]¶

    Create and return the argument parser.

    Changed in version 6.0: Added the color argument.

    Parameters:
    • argv (list of str) – A list of command line arguments

    • color (bool, optional) –

      Whether to output color, if supported in the environment.

      This will output color on Python 3.14 and higher by default.

      Added in version 6.0.

    Returns:

    Argument parser for commandline arguments

    Return type:

    argparse.ArgumentParser

    create_parser(config: RBToolsConfig, argv: list[str] | None = None, *, color: bool = True) → argparse.ArgumentParser[source]¶

    Return a new argument parser for this command.

    Changed in version 6.0: Added the color argument.

    Parameters:
    • config (dict) – The loaded RBTools configuration.

    • argv (list of str) – The list of command line arguments.

    • color (bool, optional) –

      Whether to output color, if supported in the environment.

      This will output color on Python 3.14 and higher by default.

      Added in version 6.0.

    Returns:

    The new argument parser for the command.

    Return type:

    argparse.ArgumentParser

    credentials_prompt(realm: str, uri: str, username: str | None = None, password: str | None = None, *args, **kwargs) → tuple[str, str][source]¶

    Prompt the user for credentials using the command line.

    This will prompt the user, and then return the provided username and password. This is used as a callback in the API when the user requires authorization.

    Parameters:
    • realm (str) – The HTTP realm.

    • uri (str) – The URI of the endpoint requiring authentication.

    • username (str, optional) – The default username for authentication.

    • password (str, optional) – The default password for authentication.

    • *args (tuple, unused) – Unused additional positional arguments.

    • **kwargs (dict, unused) – Unused additional keyword arguments.

    Returns:

    A 2-tuple of:

    Tuple:
    • username (str) – The user-provided username.

    • password (str) – The user-provided password.

    Return type:

    tuple

    Raises:

    rbtools.commands.base.errors.CommandError – HTTP authentication failed.

    default_transport_cls[source]¶

    alias of SyncTransport

    description: ClassVar[str] = ''¶

    A short description of the command, suitable for display in usage text.

    Type:

    str

    diff_options = <rbtools.commands.base.options.OptionGroup object>[source]¶
    get_api(server_url: str) → tuple[RBClient, RootResource][source]¶

    Return an RBClient instance and the associated root resource.

    Commands should use this method to gain access to the API, instead of instantiating their own client. This will set the api_client attribute.

    Changed in version 6.0: This now sets the api_client attribute as soon as the client is instantiated.

    Parameters:

    server_url (str) – The URL to the Review Board server.

    Returns:

    A 2-tuple of:

    Tuple:
    • 0 (rbtools.api.client.RBClient) – The new API client.

    • 1 (rbtools.api.resource.RootResource) – The root resource for the API.

    Return type:

    tuple

    get_capabilities(api_root: RootResource) → Capabilities[source]¶

    Retrieve capabilities from the server and return them.

    Parameters:

    api_root (rbtools.api.resource.RootResource) – The root resource

    Returns:

    The server capabilities.

    Return type:

    rbtools.api.capabilities.Capabilities

    get_options_flat() → Sequence[Option][source]¶

    Return a list of all options for the command.

    This returns a flat list of options, pulling out the options that are inside any option groups set on the command.

    Added in version 6.0.

    Returns:

    The list of options for the command.

    Return type:

    list of rbtools.commands.base.options.Option

    git_options = <rbtools.commands.base.options.OptionGroup object>[source]¶
    initialize() → None[source]¶

    Initialize the command.

    This will set up various prerequisites for commands. Individual command subclasses can control what gets done by setting the various needs_* attributes (as documented in this class).

    Raises:
    • rbtools.commands.base.errors.CommandError – An error occurred while initializing the command.

    • rbtools.commands.base.errors.NeedsReinitialize – The initialization process needs to be restarted (due to loading additional config).

    initialize_scm_tool(client_name: str | None = None, *, tool_required: bool = True) → tuple[RepositoryInfo | None, BaseSCMClient | None][source]¶

    Initialize the SCM tool for the current working directory.

    Changed in version 5.0.3: Added the tool_required argument.

    Changed in version 5.0: Removed deprecated require_repository_info argument.

    Parameters:
    • client_name (str, optional) – A specific client name, which can come from the configuration. This can be used to disambiguate if there are nested repositories, or to speed up detection.

    • tool_required (bool, optional) –

      Whether a tool is required to be found or not.

      Added in version 5.0.3.

    Returns:

    A 2-tuple:

    Tuple:
    • 0 (rbtools.clients.base.repository.RepositoryInfo) – The repository information.

    • 1 (rbtools.clients.base.scmclient.BaseSCMClient) – The SCMTool client instance.

    Return type:

    tuple

    json: JSONOutput¶

    An output buffer for JSON results.

    Commands can set this to return data used when a command is passed --json.

    log: logging.Logger¶

    A logger for the command.

    main(*args) → int[source]¶

    Run the main logic of the command.

    This method should be overridden to implement the commands functionality.

    Parameters:

    *args (tuple) – Positional arguments passed to the command.

    Returns:

    The resulting exit code.

    Return type:

    int

    name: ClassVar[str] = ''¶

    The name of the command.

    Type:

    str

    needs_api: ClassVar[bool] = False¶

    Whether the command needs the API client.

    If this is set, the initialization of the command will set api_client and api_root.

    Added in version 3.0.

    Type:

    bool

    needs_diffs: ClassVar[bool] = False¶

    Whether the command needs to generate diffs.

    If this is set, the initialization of the command will check for the presence of a diff tool compatible with the chosen type of repository.

    This depends on needs_repository and needs_scm_client both being set to True.

    Added in version 4.0.

    Type:

    bool

    needs_repository: ClassVar[bool] = False¶

    Whether the command needs the remote repository object.

    If this is set, the initialization of the command will set repository.

    Setting this will imply setting both needs_api and needs_scm_client to True.

    Added in version 3.0.

    Type:

    bool

    needs_scm_client: ClassVar[bool] = False¶

    Whether the command needs the SCM client.

    If this is set, the initialization of the command will set repository_info and tool.

    Added in version 3.0.

    Type:

    bool

    option_list: ClassVar[list[Option | OptionGroup]] = []¶

    Command-line options for this command.

    Type:

    list of Option or OptionGroup

    options: argparse.Namespace¶

    Options parsed for the command.

    otp_token_prompt(uri: str, token_method: str, *args, **kwargs) → str[source]¶

    Prompt the user for a one-time password token.

    Their account is configured with two-factor authentication. The server will have sent a token to their configured mobile device or application. The user will be prompted for this token.

    Parameters:
    • uri (str) – The URI of the endpoint requiring authentication.

    • token_method (str) – The token method requested.

    • *args (tuple, unused) – Unused positional arguments.

    • **kwargs (dict, unused) – Unused keyword arguments.

    Returns:

    The user-provided token.

    Return type:

    str

    perforce_options = <rbtools.commands.base.options.OptionGroup object>[source]¶
    post_process_options() → None[source]¶

    Post-process options for the command.

    This can validate and update options before the command is invoked.

    Raises:

    rbtools.commands.base.errors.CommandError – There was an error found with an option.

    repository: RepositoryItemResource | None¶

    The resource for the matching repository.

    This will be set when the command is run if both needs_api and needs_repository are True.

    repository_info: RepositoryInfo | None¶

    Information on the local repository.

    This will be set when the command is run if needs_scm_client is run. Otherwise it will be None.

    repository_options = <rbtools.commands.base.options.OptionGroup object>[source]¶
    run_from_argv(argv: list[str]) → None[source]¶

    Execute the command using the provided arguments.

    The options and commandline arguments will be parsed from argv and the commands main method will be called.

    Parameters:

    argv (list of str) – A list of command line arguments

    server_options = <rbtools.commands.base.options.OptionGroup object>[source]¶
    server_url: str | None¶

    The URL to the Review Board server.

    This will be set when the command is run if needs_api is True.

    stderr: OutputWrapper[str]¶

    The stream for writing error output as Unicode strings.

    Commands should write error text using this instead of print() or sys.stderr().

    stderr_bytes: OutputWrapper[bytes]¶

    The stream for writing error output as byte strings.

    Commands should write error text using this instead of print() or sys.stderr().

    stderr_is_atty: bool¶

    Whether the stderr stream is from an interactive session.

    This applies to stderr.

    Added in version 3.1.

    stdin: TextIO¶

    The stream for reading standard input.

    Commands should read input from here instead of using sys.stdin().

    Added in version 3.1.

    stdin_is_atty: bool¶

    Whether the stdin stream is from an interactive session.

    This applies to stdin.

    Added in version 3.1.

    stdout: OutputWrapper[str]¶

    The stream for writing standard output as Unicode strings.

    Commands should write text using this instead of print() or sys.stdout().

    stdout_bytes: OutputWrapper[bytes]¶

    The stream for writing standard output as byte strings.

    Commands should write text using this instead of print() or sys.stdout().

    stdout_is_atty: bool¶

    Whether the stdout stream is from an interactive session.

    This applies to stdout.

    Added in version 3.1.

    subversion_options = <rbtools.commands.base.options.OptionGroup object>[source]¶
    tfs_options = <rbtools.commands.base.options.OptionGroup object>[source]¶
    tool: BaseSCMClient | None¶

    The client/tool used to communicate with the repository.

    This will be set when the command is run if needs_scm_client is run. Otherwise it will be None.

    transport_cls: type[Transport]¶

    The transport class used for talking to the API.

    usage() → str[source]¶

    Return a usage string for the command.

    Returns:

    Usage text for the command.

    Return type:

    str

    web_login_callback() → bool[source]¶

    Attempt to authorize using web-based login.

    This is used as a callback in the API when the user requires authorization.

    Added in version 6.0.

    Raises:

    rbtools.utils.web_login.WebLoginNotAllowed – Web-based login is not available on the Review Board server.

    class rbtools.commands.base.commands.BaseMultiCommand(transport_cls: type[Transport] = <class 'rbtools.api.transport.sync.SyncTransport'>, stdout: TextIO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, stderr: TextIO = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, stdin: TextIO = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>)[source]¶

    Bases: BaseCommand

    Abstract base class for commands which offer subcommands.

    Some commands (such as rbt review) want to offer many subcommands.

    Added in version 3.0.

    __firstlineno__ = 1835¶
    __static_attributes__ = ('subcommand', 'subcommand_parsers')¶
    common_subcommand_option_list: list[Option | OptionGroup] = []¶

    Options common to all subcommands.

    Type:

    list

    create_parser(config: RBToolsConfig, argv: list[str] | None = None, *, color: bool = True) → argparse.ArgumentParser[source]¶

    Create and return the argument parser for this command.

    Changed in version 6.0: Added the color argument.

    Parameters:
    • config (dict) – The loaded RBTools config.

    • argv (list, optional) – The argument list.

    • color (bool, optional) –

      Whether to output color, if supported in the environment.

      This will output color on Python 3.14 and higher by default.

      Added in version 6.0.

    Returns:

    The argument parser.

    Return type:

    argparse.ArgumentParser

    get_options_flat() → Sequence[Option][source]¶

    Return a list of all options for the command.

    This returns a flat list of options, pulling out the options that are inside any option groups set on the command, and in any subcommands.

    Added in version 6.0.

    Returns:

    The list of options for the command.

    Return type:

    list of rbtools.commands.base.options.Option

    initialize() → None[source]¶

    Initialize the command.

    main(*args) → int[source]¶

    Run the command.

    Parameters:

    *args (tuple) – Positional arguments passed to the command.

    Returns:

    The resulting exit code.

    Return type:

    int

    subcommand: BaseSubCommand¶

    The currently-running subcommand.

    subcommand_parsers: dict[str, argparse.ArgumentParser]¶

    A mapping of subcommand names to argument parsers.

    subcommands: list[type[BaseSubCommand]] = []¶

    The available subcommands.

    This is a list of BaseSubCommand subclasses.

    Type:

    list

    usage(command_cls: type[BaseSubCommand] | None = None) → str[source]¶

    Return a usage string for the command.

    Parameters:

    command_cls (type, optional) – The subcommand class to generate usage information for.

    Returns:

    The usage string.

    Return type:

    str

    class rbtools.commands.base.commands.BaseSubCommand(options: Namespace, config: RBToolsConfig, *args, **kwargs)[source]¶

    Bases: BaseCommand

    Abstract base class for a subcommand.

    __firstlineno__ = 1799¶
    __init__(options: Namespace, config: RBToolsConfig, *args, **kwargs) → None[source]¶

    Initialize the subcommand.

    Parameters:
    • options (argparse.Namespace) – The parsed options.

    • config (rbtools.config.RBToolsConfigg) – The loaded RBTools configuration.

    • *args (list) – Positional arguments to pass to the Command class.

    • **kwargs (dict) – Keyword arguments to pass to the Command class.

    __static_attributes__ = ('config', 'options')¶
    help_text: str = ''¶

    The subcommand’s help text.

    Type:

    str

    class rbtools.commands.base.commands.LogLevelFilter(level: int)[source]¶

    Bases: Filter

    Filters log messages of a given level.

    Only log messages that have the specified level will be allowed by this filter. This prevents propagation of higher level types to lower log handlers.

    __annotations_cache__ = {}¶
    __firstlineno__ = 63¶
    __init__(level: int) → None[source]¶

    Initialize the filter.

    Parameters:

    level (int) – The log level to filter for.

    __static_attributes__ = ('level',)¶
    filter(record: LogRecord) → bool[source]¶

    Filter a log record.

    Parameters:

    record (logging.LogRecord) – The record to filter.

    Returns:

    True if the record’s log level matches the filter.

    Return type:

    bool

    class rbtools.commands.base.commands.SmartHelpFormatter(prog, indent_increment=2, max_help_position=24, width=None, color=True)[source]¶

    Bases: HelpFormatter

    Smartly formats help text, preserving paragraphs.

    Changed in version 5.0: This moved from rbtools.commands to rbtools.commands.base.commands.

    __annotations_cache__ = {}¶
    __firstlineno__ = 100¶
    __static_attributes__ = ()¶

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2026 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]
    • BaseCommand
      • BaseCommand.__firstlineno__
      • BaseCommand.__init__()
      • BaseCommand.__static_attributes__
      • BaseCommand.api_client
      • BaseCommand.api_root
      • BaseCommand.args
      • BaseCommand.author
      • BaseCommand.branch_options
      • BaseCommand.capabilities
      • BaseCommand.config
      • BaseCommand.create_arg_parser()
      • BaseCommand.create_parser()
      • BaseCommand.credentials_prompt()
      • BaseCommand.default_transport_cls
      • BaseCommand.description
      • BaseCommand.diff_options
      • BaseCommand.get_api()
      • BaseCommand.get_capabilities()
      • BaseCommand.get_options_flat()
      • BaseCommand.git_options
      • BaseCommand.initialize()
      • BaseCommand.initialize_scm_tool()
      • BaseCommand.json
      • BaseCommand.log
      • BaseCommand.main()
      • BaseCommand.name
      • BaseCommand.needs_api
      • BaseCommand.needs_diffs
      • BaseCommand.needs_repository
      • BaseCommand.needs_scm_client
      • BaseCommand.option_list
      • BaseCommand.options
      • BaseCommand.otp_token_prompt()
      • BaseCommand.perforce_options
      • BaseCommand.post_process_options()
      • BaseCommand.repository
      • BaseCommand.repository_info
      • BaseCommand.repository_options
      • BaseCommand.run_from_argv()
      • BaseCommand.server_options
      • BaseCommand.server_url
      • BaseCommand.stderr
      • BaseCommand.stderr_bytes
      • BaseCommand.stderr_is_atty
      • BaseCommand.stdin
      • BaseCommand.stdin_is_atty
      • BaseCommand.stdout
      • BaseCommand.stdout_bytes
      • BaseCommand.stdout_is_atty
      • BaseCommand.subversion_options
      • BaseCommand.tfs_options
      • BaseCommand.tool
      • BaseCommand.transport_cls
      • BaseCommand.usage()
      • BaseCommand.web_login_callback()
    • BaseMultiCommand
      • BaseMultiCommand.__firstlineno__
      • BaseMultiCommand.__static_attributes__
      • BaseMultiCommand.common_subcommand_option_list
      • BaseMultiCommand.create_parser()
      • BaseMultiCommand.get_options_flat()
      • BaseMultiCommand.initialize()
      • BaseMultiCommand.main()
      • BaseMultiCommand.subcommand
      • BaseMultiCommand.subcommand_parsers
      • BaseMultiCommand.subcommands
      • BaseMultiCommand.usage()
    • BaseSubCommand
      • BaseSubCommand.__firstlineno__
      • BaseSubCommand.__init__()
      • BaseSubCommand.__static_attributes__
      • BaseSubCommand.help_text
    • LogLevelFilter
      • LogLevelFilter.__annotations_cache__
      • LogLevelFilter.__firstlineno__
      • LogLevelFilter.__init__()
      • LogLevelFilter.__static_attributes__
      • LogLevelFilter.filter()
    • SmartHelpFormatter
      • SmartHelpFormatter.__annotations_cache__
      • SmartHelpFormatter.__firstlineno__
      • SmartHelpFormatter.__static_attributes__