From: Christian Van Wambeke Date: Tue, 20 Mar 2018 12:53:14 +0000 (+0100) Subject: temporary fix #8638 add config -debug value X-Git-Tag: 5.1.0~52 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3853693ba08812ff7cae626ef6e6be8310106ca8;p=tools%2Fsat.git temporary fix #8638 add config -debug value --- diff --git a/commands/config.py b/commands/config.py index f048db3..547fd9e 100644 --- a/commands/config.py +++ b/commands/config.py @@ -34,6 +34,8 @@ gettext.install('salomeTools', os.path.join(satdir, 'src', 'i18n')) parser = src.options.Options() parser.add_option('v', 'value', 'string', 'value', _("Optional: print the value of CONFIG_VARIABLE.")) +parser.add_option('g', 'debug', 'string', 'debug', + _("Optional: print the debugging mode value of CONFIG_VARIABLE.")) parser.add_option('e', 'edit', 'boolean', 'edit', _("Optional: edit the product configuration file.")) parser.add_option('i', 'info', 'string', 'info', @@ -861,6 +863,18 @@ def run(args, runner, logger): print_value(runner.cfg, options.value, not options.no_label, logger, level=0, show_full_path=False) + # case : print a debug value of the config + if options.debug: + if options.debug == ".": + # if argument is ".", print all the config + res = DBG.indent(DBG.getStrConfigDbg(runner.cfg)) + logger.write("\nConfig of application %s:\n\n%s\n" % (runner.cfg.VARS.application, res)) + else: + exec("a = runner.cfg.%s" % options.debug) + res = DBG.indent(DBG.getStrConfigDbg(a)) + logger.write("\nConfig.%s of application %s:\n\n%s\n" % (options.debug, runner.cfg.VARS.application, res)) + + # case : edit user pyconf file or application file elif options.edit: editor = runner.cfg.USER.editor