b.c.Config(object) : class documentation

Part of bzrlib.config View In Hierarchy

Known subclasses: bzrlib.config.BranchConfig, bzrlib.config.IniBasedConfig, bzrlib.tests.test_config.InstrumentedConfig

A configuration policy - what username, editor, gpg needs etc.
Method __init__ Undocumented
Method config_id Returns a unique ID for the config.
Method get_editor Get the users pop up editor.
Method get_change_editor Undocumented
Method get_mail_client Get a mail client to use
Method expand_options Expand option references in the string in the configuration context.
Method get_user_option Get a generic option - no special process, no default.
Method get_user_option_as_bool Get a generic option as a boolean.
Method get_user_option_as_list Get a generic option as a list - no special process, no default.
Method get_user_option_as_int_from_SI Get a generic option from a human readable size in SI units, e.g 10MB
Method gpg_signing_command What program should be used to sign signatures?
Method log_format What log format should be used
Method validate_signatures_in_log Show GPG signature validity in log
Method acceptable_keys Comma separated list of key patterns acceptable to
Method post_commit An ordered list of python functions to call.
Method user_email Return just the email component of a username.
Method username Return email-style username.
Method ensure_username Raise errors.NoWhoami if username is not set.
Method signature_checking What is the current policy for signature checking?.
Method signing_policy What is the current policy for signature checking?.
Method signature_needed Is a signature needed when committing ?.
Method gpg_signing_key GPG user-id to sign commits
Method get_alias Undocumented
Method get_nickname Undocumented
Method get_bzr_remote_path Undocumented
Method suppress_warning Should the warning be suppressed or emitted.
Method get_merge_tools Undocumented
Method find_merge_tool Undocumented
Method _get_signature_checking Template method to override signature checking policy.
Method _get_signing_policy Template method to override signature creation policy.
Method _expand_options_in_list Expand options in a list of strings in the configuration context.
Method _expand_options_in_string Expand options in the string in the configuration context.
Method _expand_option Undocumented
Method _get_user_option Template method to provide a user option.
Method _gpg_signing_command See gpg_signing_command().
Method _log_format See log_format().
Method _validate_signatures_in_log See validate_signatures_in_log().
Method _acceptable_keys See acceptable_keys().
Method _post_commit See Config.post_commit.
Method _get_alias Undocumented
Method _get_nickname Undocumented
def __init__(self):
Undocumented
def config_id(self):
Returns a unique ID for the config.
@deprecated_method(deprecated_in((2, 4, 0)))
def get_editor(self):
Get the users pop up editor.
def get_change_editor(self, old_tree, new_tree):
Undocumented
def get_mail_client(self):
Get a mail client to use
def _get_signature_checking(self):
Template method to override signature checking policy.
def _get_signing_policy(self):
Template method to override signature creation policy.
def expand_options(self, string, env=None):
Expand option references in the string in the configuration context.
ParametersstringThe string containing option to expand.
envAn option dict defining additional configuration options or overriding existing ones.
ReturnsThe expanded string.
def _expand_options_in_list(self, slist, env=None, _ref_stack=None):
Expand options in a list of strings in the configuration context.
ParametersslistA list of strings.
envAn option dict defining additional configuration options or overriding existing ones.
_ref_stackPrivate list containing the options being expanded to detect loops.
ReturnsThe flatten list of expanded strings.
def _expand_options_in_string(self, string, env=None, _ref_stack=None):
Expand options in the string in the configuration context.
ParametersstringThe string to be expanded.
envAn option dict defining additional configuration options or overriding existing ones.
_ref_stackPrivate list containing the options being expanded to detect loops.
ReturnsThe expanded string.
def _expand_option(self, name, env, _ref_stack):
Undocumented
def _get_user_option(self, option_name):
Template method to provide a user option.
def get_user_option(self, option_name, expand=None):
Get a generic option - no special process, no default.
Parametersoption_nameThe queried option.
expandWhether options references should be expanded.
ReturnsThe value of the option.
def get_user_option_as_bool(self, option_name, expand=None, default=None):
Get a generic option as a boolean.

:param expand: Allow expanding references to other config values.
:param default: Default value if nothing is configured
:return None if the option doesn't exist or its value can't be
    interpreted as a boolean. Returns True or False otherwise.
def get_user_option_as_list(self, option_name, expand=None):

Get a generic option as a list - no special process, no default.

:return None if the option doesn't exist. Returns the value as a list
otherwise.
def get_user_option_as_int_from_SI(self, option_name, default=None):

Get a generic option from a human readable size in SI units, e.g 10MB

Accepted suffixes are K,M,G. It is case-insensitive and may be followed by a trailing b (i.e. Kb, MB). This is intended to be practical and not pedantic.

:return Integer, expanded to its base-10 value if a proper SI unit is
found. If the option doesn't exist, or isn't a value in SI units, return default (which defaults to None)
def gpg_signing_command(self):
What program should be used to sign signatures?
def _gpg_signing_command(self):
See gpg_signing_command().
def log_format(self):
What log format should be used
def _log_format(self):
See log_format().
def validate_signatures_in_log(self):
Show GPG signature validity in log
def _validate_signatures_in_log(self):
See validate_signatures_in_log().
def acceptable_keys(self):
Comma separated list of key patterns acceptable to verify-signatures command
def _acceptable_keys(self):
See acceptable_keys().
def post_commit(self):
An ordered list of python functions to call.

Each function takes branch, rev_id as parameters.

def _post_commit(self):
See Config.post_commit.
def user_email(self):
Return just the email component of a username.
def username(self):
Return email-style username.

Something similar to 'Martin Pool <mbp@sourcefrog.net>'

$BZR_EMAIL can be set to override this, then the concrete policy type is checked, and finally $EMAIL is examined. If no username can be found, errors.NoWhoami exception is raised.

def ensure_username(self):
Raise errors.NoWhoami if username is not set.

This method relies on the username() function raising the error.

def signature_checking(self):
What is the current policy for signature checking?.
def signing_policy(self):
What is the current policy for signature checking?.
def signature_needed(self):
Is a signature needed when committing ?.
def gpg_signing_key(self):
GPG user-id to sign commits
def get_alias(self, value):
Undocumented
def _get_alias(self, value):
Undocumented
def get_nickname(self):
Undocumented
def _get_nickname(self):
Undocumented
def get_bzr_remote_path(self):
Undocumented
def suppress_warning(self, warning):
Should the warning be suppressed or emitted.
ParameterswarningThe name of the warning being tested.
ReturnsTrue if the warning should be suppressed, False otherwise.
def get_merge_tools(self):
Undocumented
def find_merge_tool(self, name):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.