b.c.Option(object) : class documentation

Part of bzrlib.config View In Hierarchy

An option definition.

The option values are stored in config files and found in sections.

Here we define various properties about the option itself, its default value, how to convert it from stores, what to do when invalid values are encoutered, in which config files it can be stored.

Method __init__ Build an option definition.
Method convert_from_unicode Undocumented
Method get_default Undocumented
Method get_help_text Undocumented
def __init__(self, name, default=None, default_from_env=None, help=None, from_unicode=None, invalid=None):
Build an option definition.
Parametersnamethe name used to refer to the option.
defaultthe default value to use when none exist in the config stores. This is either a string that from_unicode will convert into the proper type or a python object that can be stringified (so only the empty list is supported for example).
default_from_envA list of environment variables which can provide a default value. 'default' will be used only if none of the variables specified here are set in the environment.
helpa doc string to explain the option to the user.
from_unicodea callable to convert the unicode string representing the option value in a store. This is not called for the default value.
invalidthe action to be taken when an invalid value is encountered in a store. This is called only when from_unicode is invoked to convert a string and returns None or raise ValueError or TypeError. Accepted values are: None (ignore invalid values), 'warning' (emit a warning), 'error' (emit an error message and terminates).
def convert_from_unicode(self, unicode_value):
def get_default(self):
def get_help_text(self, additional_see_also=None, plain=True):
API Documentation for Bazaar, generated by pydoctor at 2019-10-16 00:36:43.