Trees | Indices | Help |
|
---|
|
optparse.OptionContainer --+ | optparse.OptionParser --+ | GbpOptionParser
Handles commandline options and parsing of config files
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
str or None
|
|
||
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|||
list
>>> conf_backup = os.getenv('GBP_CONF_FILES') >>> if conf_backup is not None: del os.environ['GBP_CONF_FILES'] >>> homedir = os.path.expanduser("~") >>> files = GbpOptionParser.get_config_files() >>> files_mangled = [file.replace(homedir, 'HOME') for file in files] >>> sorted(files_mangled) ['%(git_dir)s/gbp.conf', '%(top_dir)s/.gbp.conf', '%(top_dir)s/debian/gbp.conf', '/etc/git-buildpackage/gbp.conf', 'HOME/.gbp.conf'] >>> files = GbpOptionParser.get_config_files(no_local=True) >>> files_mangled = [file.replace(homedir, 'HOME') for file in files] >>> sorted(files_mangled) ['/etc/git-buildpackage/gbp.conf', 'HOME/.gbp.conf'] >>> os.environ['GBP_CONF_FILES'] = 'test1:test2' >>> GbpOptionParser.get_config_files() ['test1', 'test2'] >>> del os.environ['GBP_CONF_FILES'] >>> if conf_backup is not None: os.environ['GBP_CONF_FILES'] = conf_backup |
|
||
|
|||
|
|
|||
dict |
defaults =
defaults value of an option if not in the config file or given on the command line |
||
dict |
help =
help messages |
||
dict (type, path) |
def_config_files =
config files we parse |
||
Inherited from |
|
|||
string |
command the gbp command we store the options for |
||
dict |
config current configuration parameters |
||
string |
prefix prefix to prepend to all commandline options |
|
Get list of config files from the GBP_CONF_FILES environment variable.
|
|
set a option for the command line parser, the default is read from the config file param option_name: name of the option type option_name: string param dest: where to store this option type dest: string param help: help text type help: string
|
Query a single interpolated config file value.
|
Print an extended help message, listing all options and any help text provided with them, to 'file' (default stdout).
|
Translate a name like 'system' to a config file name >>> GbpOptionParser._name_to_filename('foo') >>> GbpOptionParser._name_to_filename('system') '/etc/git-buildpackage/gbp.conf' >>> GbpOptionParser._name_to_filename('global') '~/.gbp.conf' >>> GbpOptionParser._name_to_filename('debian') '%(top_dir)s/debian/gbp.conf' |
Write a config value to a file creating it if needed On errors a ConfigParserError is raised |
|
defaultsdefaults value of an option if not in the config file or given on the command line
|
helphelp messages
|
def_config_filesconfig files we parse
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Mar 1 10:01:46 2016 | http://epydoc.sourceforge.net |