b.c.IniBasedConfig(Config) : class documentation

Part of bzrlib.config View In Hierarchy

Known subclasses: bzrlib.config.LockableConfig, bzrlib.config.TreeConfig

A configuration policy that draws from ini files.
Method __init__ Base class for configuration files using an ini-like syntax.
Class Method from_string Create a config object from a string.
Method reload Reload the config file from disk.
Method remove_user_option Remove a user option and save the configuration file.
Method _create_from_string Undocumented
Method _get_parser Undocumented
Method _get_matching_sections Return an ordered list of (section_name, extra_path) pairs.
Method _get_section Override this to define the section used by the config.
Method _get_sections Returns an iterator of the sections specified by name.
Method _get_options Return an ordered list of (name, value, section, config_id) tuples.
Method _get_option_policy Return the policy for the given (section, option_name) pair.
Method _get_change_editor Undocumented
Method _get_signature_checking See Config._get_signature_checking.
Method _get_signing_policy See Config._get_signing_policy
Method _get_user_id Get the user id from the 'email' key in the current section.
Method _get_user_option See Config._get_user_option.
Method _gpg_signing_command See Config.gpg_signing_command.
Method _log_format See Config.log_format.
Method _validate_signatures_in_log See Config.validate_signatures_in_log.
Method _acceptable_keys See Config.acceptable_keys.
Method _post_commit See Config.post_commit.
Method _string_to_signature_policy Convert a string to a signing policy.
Method _string_to_signing_policy Convert a string to a signing policy.
Method _get_alias Undocumented
Method _get_nickname Undocumented
Method _write_config_file Undocumented

Inherited from Config:

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 _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
def __init__(self, get_filename=symbol_versioning.DEPRECATED_PARAMETER, file_name=None):
Base class for configuration files using an ini-like syntax.
Parametersfile_nameThe configuration file path.
@classmethod
def from_string(cls, str_or_unicode, file_name=None, save=False):
Create a config object from a string.
Parametersstr_or_unicodeA string representing the file content. This will be utf-8 encoded.
file_nameThe configuration file path.
_saveWhether the file should be saved upon creation.
def _create_from_string(self, str_or_unicode, save):
Undocumented
def _get_parser(self, file=symbol_versioning.DEPRECATED_PARAMETER):
Undocumented
def reload(self):
Reload the config file from disk.
def _get_matching_sections(self):
Return an ordered list of (section_name, extra_path) pairs.

If the section contains inherited configuration, extra_path is a string containing the additional path components.

def _get_section(self):
Override this to define the section used by the config.
def _get_sections(self, name=None):
Returns an iterator of the sections specified by name.
ParametersnameThe section name. If None is supplied, the default configurations are yielded.
ReturnsA tuple (name, section, config_id) for all sections that will be walked by user_get_option() in the 'right' order. The first one is where set_user_option() will update the value.
def _get_options(self, sections=None):
Return an ordered list of (name, value, section, config_id) tuples.

All options are returned with their associated value and the section they appeared in. config_id is a unique identifier for the configuration file the option is defined in.

ParameterssectionsDefault to _get_matching_sections if not specified. This gives a better control to daughter classes about which sections should be searched. This is a list of (name, configobj) tuples.
def _get_option_policy(self, section, option_name):
Return the policy for the given (section, option_name) pair.
def _get_change_editor(self):
Undocumented
def _get_signature_checking(self):
See Config._get_signature_checking.
def _get_signing_policy(self):
See Config._get_signing_policy
def _get_user_id(self):
Get the user id from the 'email' key in the current section.
def _get_user_option(self, option_name):
See Config._get_user_option.
def _gpg_signing_command(self):
See Config.gpg_signing_command.
def _log_format(self):
See Config.log_format.
def _validate_signatures_in_log(self):
See Config.validate_signatures_in_log.
def _acceptable_keys(self):
See Config.acceptable_keys.
def _post_commit(self):
See Config.post_commit.
def _string_to_signature_policy(self, signature_string):
Convert a string to a signing policy.
def _string_to_signing_policy(self, signature_string):
Convert a string to a signing policy.
def _get_alias(self, value):
Undocumented
def _get_nickname(self):
Undocumented
def remove_user_option(self, option_name, section_name=None):
Remove a user option and save the configuration file.
Parametersoption_nameThe option to be removed.
section_nameThe section the option is defined in, default to the default section.
def _write_config_file(self):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.