From 8118b3c86e3601cb5251ccc9cfc5fd6e03d623df Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Thu, 17 Sep 2020 13:59:44 -0400 Subject: [PATCH] Allow override of parser object in config --- opendm/config.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/opendm/config.py b/opendm/config.py index a3df6e9b..903a62c6 100755 --- a/opendm/config.py +++ b/opendm/config.py @@ -62,15 +62,16 @@ class StoreValue(argparse.Action): args = None -def config(argv=None): +def config(argv=None, parser=None): global args if args is not None and argv is None: return args - parser = SettingsParser(description='ODM', - usage='%(prog)s [options] ', - yaml_file=open(context.settings_path)) + if parser is None: + parser = SettingsParser(description='ODM', + usage='%(prog)s [options] ', + yaml_file=open(context.settings_path)) parser.add_argument('--project-path', metavar='',