Part of bzrlib.config View In Hierarchy
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 |
Parameters | name | the name used to refer to the option. |
default | the 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_env | A 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. | |
help | a doc string to explain the option to the user. | |
from_unicode | a callable to convert the unicode string representing the option value in a store. This is not called for the default value. | |
invalid | the 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). |