Mercurial > hg > configuration
changeset 47:7abea9a6fa16
try using optionclass; still failing
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 27 Mar 2012 12:32:15 -0700 |
parents | 346c702f63db |
children | 84fb8ad5ba81 |
files | configuration/config.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/configuration/config.py Tue Mar 27 12:26:58 2012 -0700 +++ b/configuration/config.py Tue Mar 27 12:32:15 2012 -0700 @@ -287,6 +287,7 @@ else: return '' parser_args['formatter'] = PlainDescriptionFormatter() + parser_args.setdefault('option_class', ConfigurationOption) parser = optparse.OptionParser(**parser_args) self.optparse_options(parser) @@ -314,7 +315,8 @@ if hasattr(parser, 'parsed'): # only use parsed arguments # (though i'm not sure what to do with parser doesn't have the parsed attribute) - pass + cli_config = dict([(key, value) for key, value in cli_config.items() + if key in parser.parsed]) # generate configuration self(cli_config)