config: add get_option() method
This commit is contained in:
parent
ade97bc90f
commit
5f0527f0c3
1 changed files with 6 additions and 0 deletions
|
@ -649,6 +649,12 @@ class Config: # pylint: disable=too-many-instance-attributes
|
||||||
log.debug('get(%s, %s): %s (%s)', section, option, value, type(value))
|
log.debug('get(%s, %s): %s (%s)', section, option, value, type(value))
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
def get_option(self, option, default=None):
|
||||||
|
""" Get an argument parser option value """
|
||||||
|
if self.options and hasattr(self.options, option):
|
||||||
|
return getattr(self.options, option)
|
||||||
|
return default
|
||||||
|
|
||||||
def set(self, section, option, value):
|
def set(self, section, option, value):
|
||||||
""" Set option value """
|
""" Set option value """
|
||||||
assert self.config_parser, 'Unconfigured options parser'
|
assert self.config_parser, 'Unconfigured options parser'
|
||||||
|
|
Loading…
Reference in a new issue