rbtools.config.config¶
Configuration for RBTools.
These classes manage access to loaded RBTools configuration, and provide type hints for all RBTools-provided settings.
Added in version 5.0.
Module Attributes
A dictionary storing raw configuration data. |
Classes
|
Configuration for terminal colors. |
|
Wrapper for configuration data. |
|
A flag indicating whether to guess state. |
|
Configuration for a .reviewboardrc file. |
- class rbtools.config.config.ColorsConfig(*, config_dict: dict[str, Any] | None = None, filename: str | None = None)[source]¶
Bases:
ConfigDataConfiguration for terminal colors.
Added in version 5.0.
- __firstlineno__ = 345¶
- __static_attributes__ = ()¶
- class rbtools.config.config.ConfigData(*, config_dict: dict[str, Any] | None = None, filename: str | None = None)[source]¶
Bases:
objectWrapper for configuration data.
This stores raw configuration data, providing both dictionary-like and attribute-like access to it, as well as allowing subclasses to wrap dictionaries in another
ConfigDatainstance.Subclasses are expected to add type annotations for every known field that should be accessed through the class.
- __contains__(key: str) bool[source]¶
Return whether a key is found in the configuration.
A key will be considered found if it either has a default value or is present in the loaded configuration data.
- __delitem__(name: str) None[source]¶
Remove a key from the configuration.
- Parameters:
name (
str) – The name of the key to remove.
- __eq__(other: Any) bool[source]¶
Return whether this configuration is equal to another.
Configurations are equal if they are of the same type and have the same stored settings.
The filename is not factored in.
- __firstlineno__ = 27¶
- __getattribute__(name: str) Any[source]¶
Return the value for a configuration key as an attribute.
This will return the value from the loaded configuration data, falling back to class-specified default value if one exists.
- Parameters:
name (
str) – The configuration key.- Returns:
The configuration value, if found or if it has a default.
- Return type:
- Raises:
AttributeError – The configuration key or default was not found.
- __getitem__(name: str) Any[source]¶
Return the value for a configuration key as a dictionary key.
This will return the value from the loaded configuration data, falling back to class-specified default value if one exists.
- __hash__ = None¶
- __init__(*, config_dict: dict[str, Any] | None = None, filename: str | None = None) None[source]¶
Initialize the configuration data wrapper.
- __repr__() str[source]¶
Return a string representation of the configuration data.
- Returns:
The string representation.
- Return type:
- __set_name__(owner: type[object], name: str) None[source]¶
Handle an assignment of this instance to a class.
If setting this on another
ConfigData, this will be registered in the owner class’s list of wrappers.
- __static_attributes__ = ('_raw_config', 'filename')¶
- copy() Self[source]¶
Return a copy of this configuration data.
- Returns:
A copy of this instance’s class with a copy of the data.
- Return type:
- get(key: str, default: Any = None) Any[source]¶
Return a value from a configuration item.
This will return the value from the loaded configuration data, falling back to class-specified default value or the provided default value.
This helps emulate dictionary-based access.
- merge(other_config: ConfigData) None[source]¶
Merge other configuration into this one.
Any
ConfigDataor dictionary values will be merged recursively.- Parameters:
other_config (
ConfigData) – The configuration data to merge in.
- rbtools.config.config.ConfigDict¶
A dictionary storing raw configuration data.
- class rbtools.config.config.GuessFlag(*values)[source]¶
-
A flag indicating whether to guess state.
Added in version 5.0.
- __format__(format_spec)¶
Return a formatted version of the string as described by format_spec.
- __new__(value)¶
- __repr__()¶
Return repr(self).
- __str__()¶
Return str(self).
- class rbtools.config.config.RBToolsConfig(*, config_dict: dict[str, Any] | None = None, filename: str | None = None)[source]¶
Bases:
ConfigDataConfiguration for a .reviewboardrc file.
Added in version 5.0.
- API_GET_PRETTY_PRINT: bool = False¶
Whether to pretty-print the resulting API payload.
Added in version 0.5.2.
- API_TOKEN: str | None = None¶
An API token to use for authentication.
This takes place over a password.
Added in version 0.7.
- BASEDIR: str | None = None¶
The path within the repository where the diff is generated.
This will be prepended to any relative URLs in the path. Specifying this overrides any detected paths.
It’s currently only supported for Subversion, usually when using
--diff-filenameoptions.
- BRANCH: str | None = None¶
The value of the Branch field on a review request.
This will update the field when posting a change for review using
post.Other commands may use it to inspect client-side defaults, but it’s recommended to inspect the review request where possible.
- CACHE_LOCATION: str | None = None¶
The file to use for the API cache database.
If not explicitly provided, a default will be chosen.
Added in version 0.7.3.
- COLOR: ColorsConfig = <RBToolsConfig(filename=None, config={})>¶
Colors used for log/text output.
Added in version 1.0.
- COOKIES_STRICT_DOMAIN_MATCH: bool = False¶
Whether to enable strict domain matching for cookies.
By default, cookies that match both a domain and a parent domain (e.g.,
subdomain.example.comandexample.com) will both be sent in requests.Strict domains can be enabled if there’s a risk of conflict between cookies on a domain and a parent domain.
This is off by default for backwards-compatibility.
Added in version 5.1.
- DEPENDS_ON: str | None = None¶
A comma-separated list of review request IDs to depend on.
This will update the field when posting a change for review using
post.Other commands may use it to inspect client-side defaults, but it’s recommended to inspect the review request where possible.
Added in version 0.6.1.
- DISABLE_CACHE: bool = False¶
Whether to disable HTTP caching completely.
This will result in slower requests.
Added in version 0.7.3.
- EXCLUDE_PATTERNS: list[str] = []¶
A list of file patterns to exclude from the diff.
Added in version 0.7.
- EXT_AUTH_COOKIES: str | None = None¶
The path to an external cookies file with pre-fetched cookies.
This is useful with servers that require extra web authentication to access the Review Board server itself, such as certain Single Sign-On services or proxies.
Added in version 0.7.5.
- GUESS_DESCRIPTION: GuessFlag | None = None¶
Whether to guess and set a review request description from a commit.
- GUESS_FIELDS: str | None = 'auto'¶
Whether to guess and set review request fields from a commit.
This will control the values for the following settings:
- GUESS_SUMMARY: GuessFlag | None = None¶
Whether to guess and set a review request summary from a commit.
- IN_MEMORY_CACHE: bool = False¶
Whether to use an in-memory cache, instead of writing to disk.
Added in version 0.7.3.
- LAND_DELETE_BRANCH: bool = True¶
Whether to delete the local branch when landed.
This is only used when deleting local branches.
Added in version 0.7.
- LAND_DEST_BRANCH: str | None = None¶
The name of a destination branch that changes should land on.
This is required when landing.
Added in version 0.7.
- LAND_PUSH: bool = False¶
Whether to push the destination branch after landing the change.
Added in version 0.7.
- LAND_SQUASH: bool = False¶
Whether to squash multiple commits into one when landing.
Added in version 0.7.
- MARKDOWN: bool = False¶
Whether to enable Markdown for any text content.
If set, review request, review, and comment text content will be uploaded in Markdown format.
Added in version 0.6.
- PARENT_BRANCH: str | None = None¶
The parent branch the generate diffs relative to.
This is only supported by some SCMs. In general, this should not be used. Instead, revision ranges should be provided.
- PROXY_AUTHORIZATION: str | None = None¶
A value to send in Proxy-Authorization headers for HTTP requests.
This can be used to authenticate with proxy services.
- PUBLISH: bool = False¶
Whether to publish a change immediately after posting it.
To succeed, all required fields must already be filled in on the review request.
- REPOSITORY: str | None = None¶
The name of the repository on Review Board to communicate with.
Changed in version 0.6: This previously supported taking a configured repository URL. That now must be provided in
REPOSITORY_URL.
- REPOSITORY_TYPE: str | None = None¶
The type of the repository on Review Board.
This must be a value found in rbt list-repo-types.
- REPOSITORY_URL: str | None = None¶
The URL to the repository.
This can be used to override the detected URL for some SCMs or to influence certain operations.
For Subversion, this can be used to generate a diff outside of a working copy.
For Git, this can override the origin URL.
Changed in version 0.6: This previously supported taking a configured repository name. That now must be provided in
REPOSITORY.
- SQUASH_HISTORY: bool = False¶
Whether to create the review request in legacy single-commit mode.
If set, the review request will not be able to display multi-commit reviews.
This should be considered a legacy setting.
Added in version 2.0.
- STAMP_WHEN_POSTING: bool = False¶
Whether to stamp the commit message with the review request URL.
This is used by
postto perform the stamping once posted.Added in version 0.7.3.
- SUBMIT_AS: str | None = None¶
A username to use as the author of the review request.
This requires the logged-in user to have the special
reviews.can_submit_aspermission. See Automating rbt post.
- SVN_PROMPT_PASSWORD: bool = False¶
Whether to prompt for a user’s Subversion password.
Added in version 0.7.3.
- TARGET_GROUPS: str | None = None¶
A comma-separated list of group names to list as reviewers.
This will update the field when posting a change for review using
post.Other commands may use it to inspect client-side defaults, but it’s recommended to inspect the review request where possible.
- TARGET_PEOPLE: str | None = None¶
A comma-separated list of usernames to list as reviewers.
This will update the field when posting a change for review using
post.Other commands may use it to inspect client-side defaults, but it’s recommended to inspect the review request where possible.
- TF_CMD: str | None = None¶
The full path to the tf command.
This will override any detected path.
Added in version 0.7.6.
- TRACKING_BRANCH: str | None = None¶
The remote tracking branch that the local branch corresponds to.
This is used for Git and Mercurial, and will override any automatic tracking branch detection implemented by the SCM client.
- TREES: dict[str, Any] = {}¶
A mapping of paths to directory- or repository-specific configuration.
This allows the creation of a single .reviewboardrc file which can contain separate configurations for multiple repositories. The keys for this can be the repository path (remote) or the local directories. The values are dictionaries which can contain any valid .reviewboardrc config keys.
This existed in older versions (4 and below) but was limited to just the REVIEWBOARD_URL setting.
Added in version 5.1.
- WEB_LOGIN: bool = False¶
Whether to default to using web-based login for authentication.
If this is set, web-based login will be used instead of prompting for authentication credentials in the terminal.
Added in version 5.0.
- __firstlineno__ = 368¶
- __static_attributes__ = ()¶