src.pyconf.streamOpener = ConfigOpener([
osJoin(cfg.VARS.srcDir, 'internal_config')])
try:
- internal_cfg = src.pyconf.Config(open( osJoin(cfg.VARS.srcDir,
- 'internal_config', 'salomeTools.pyconf')))
+ if src.architecture.is_windows(): # special internal config for windows
+ internal_cfg = src.pyconf.Config(open( osJoin(cfg.VARS.srcDir,
+ 'internal_config', 'salomeTools_win.pyconf')))
+ else:
+ internal_cfg = src.pyconf.Config(open( osJoin(cfg.VARS.srcDir,
+ 'internal_config', 'salomeTools.pyconf')))
except src.pyconf.ConfigError as e:
raise src.SatException(_("Error in configuration file:"
" salomeTools.pyconf\n %(error)s") % \
else:
cfg['open_application'] = 'yes'
-
# =====================================================================
# Load product config files in PRODUCTS section
products_cfg = src.pyconf.Config()
for rule in self.get_command_line_overrides(options, ["USER"]):
exec('cfg.' + rule) # this cannot be factorize because of the exec
+ # remove application products "blacklisted" in rm_products field
+ if "APPLICATION" in cfg and "rm_products" in cfg.APPLICATION:
+ for prod_to_remove in cfg.APPLICATION.rm_products:
+ cfg.APPLICATION.products.__delitem__(prod_to_remove)
+ # remove rm_products section after usage
+ cfg.APPLICATION.__delitem__("rm_products")
return cfg
def set_user_config_file(self, config):
'evince',
"This is the pdf_viewer used "
"to read pdf documentation\n")
-# CNC 25/10/17 : plus nécessaire a priori
-# user_cfg.USER.addMapping("base",
-# src.pyconf.Reference(
-# user_cfg,
-# src.pyconf.DOLLAR,
-# 'workdir + $VARS.sep + "BASE"'),
-# "The products installation base (could be "
-# "ignored if this key exists in the local.pyconf"
-# " file of salomTools).\n")
src.ensure_path_exists(config.VARS.personalDir)
src.ensure_path_exists( osJoin(config.VARS.personalDir,
:param config Config: the global configuration.
:param logger Logger: The logger instance to use for the display
'''
+ if "properties" in config.APPLICATION:
+ # some properties are defined at application level, we display them
+ logger.write("Application properties:\n", 1)
+ for prop in config.APPLICATION.properties:
+ logger.write(src.printcolors.printcInfo(" %s : %s\n" % (prop, config.APPLICATION.properties[prop])), 1)
oneOrMore = False
for product in sorted(config.APPLICATION.products):
try:
product_info = src.product.get_product_config(config, product)
done = False
try:
- for i in product_info.properties:
+ for prop in product_info.properties:
if not done:
logger.write("%s:\n" % product, 1)
done = True
oneOrMore = True
- logger.write(src.printcolors.printcInfo(" %s\n" % i), 1)
+ logger.write(src.printcolors.printcInfo(" %s : %s\n" % (prop, product_info.properties[prop])), 1)
except Exception as e:
pass
except Exception as e:
# case : give a synthetic view of all patches used in the application
if options.show_properties:
src.check_config_has_application(runner.cfg)
+
# Print some informations
logger.write(_('Properties of application %s\n') %
src.printcolors.printcLabel(runner.cfg.VARS.application), 3)