diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-09-14 07:18:49 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-09-14 07:18:49 +0200 |
commit | 3b94d2373c49bd3a63fe27ecf6dbf4bee7b8c567 (patch) | |
tree | bbef7064990bdaf7be8e7a0171ca4351b613b19a /gbp/config.py | |
parent | 2122d8b441e1b5de1ec71cfd7123c31cf8f5e73f (diff) |
config: fix confusing typo
Diffstat (limited to 'gbp/config.py')
-rw-r--r-- | gbp/config.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gbp/config.py b/gbp/config.py index 3380cc89..002d078e 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -55,14 +55,16 @@ def check_tristate(option, opt, value): return val -def safe_option(f): +def save_option(f): + """save options on the underlying parser""" def _decorator(self, *args, **kwargs): obj = self option_name = kwargs.get('option_name') if not option_name and len(args): option_name = args[0] - # We're decorating GbpOption not GbpOptionParser + # We're decorating GbpOption but store valid_options on + # GbpOptionParser if not hasattr(obj, 'valid_options'): if not hasattr(obj, 'parser'): raise ValueError("Can only decorete GbpOptionParser and GbpOptionGroup not %s" % obj) @@ -577,7 +579,7 @@ class GbpOptionParser(OptionParser): default = self.config[option_name] return default - @safe_option + @save_option def add_config_file_option(self, option_name, dest, help=None, **kwargs): """ set a option for the command line parser, the default is read from the config file @@ -666,7 +668,7 @@ class GbpOptionParser(OptionParser): class GbpOptionGroup(OptionGroup): - @safe_option + @save_option def add_config_file_option(self, option_name, dest, help=None, **kwargs): """ set a option for the command line parser, the default is read from the config file |