]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
merge the optimization branch
authorSPN Salome - CEA <support-salome@cea.fr>
Tue, 18 Apr 2017 14:30:26 +0000 (16:30 +0200)
committerSPN Salome - CEA <support-salome@cea.fr>
Tue, 18 Apr 2017 14:30:26 +0000 (16:30 +0200)
1  2 
commands/config.py
complete_sat.sh

index 74b7fae7e0ea1f46cc7fb86049a56b1d644ddfb5,0efbfbd105de9491d6bcb87f4c38202fa29b6b09..f36a628b1ab9f858a0aab014866c44591b636acc
@@@ -420,10 -387,52 +387,51 @@@ class ConfigManager
                                   " %s\n" % src.printcolors.printcWarning(
                                                                        str(e)))
                      do_merge = False
+         
+             else:
+                 cfg['open_application'] = 'yes'
  
 -                        prod_cfg = src.pyconf.Config(open(
 -                                                    os.path.join(products_dir,
 -                                                                 product_file_name)),
+         # =====================================================================
+         # Load product config files in PRODUCTS section
+         products_cfg = src.pyconf.Config()
+         products_cfg.addMapping("PRODUCTS",
+                                 src.pyconf.Mapping(products_cfg),
+                                 "The products\n")
+         if application is not None:
+             src.pyconf.streamOpener = ConfigOpener(cfg.PATHS.PRODUCTPATH)
+             for product_name in application_cfg.APPLICATION.products.keys():
+                 # Loop on all files that are in softsDir directory
+                 # and read their config
+                 product_file_name = product_name + ".pyconf"
+                 product_file_path = src.find_file_in_lpath(product_file_name, cfg.PATHS.PRODUCTPATH)
+                 if product_file_path:
+                     products_dir = os.path.dirname(product_file_path)
+                     try:
++                        prod_cfg = src.pyconf.Config(open(product_file_path),
+                                                      PWD=("", products_dir))
++                        prod_cfg.from_file = product_file_path
+                         products_cfg.PRODUCTS[product_name] = prod_cfg
+                     except Exception as e:
+                         msg = _(
+                             "WARNING: Error in configuration file"
+                             ": %(prod)s\n  %(error)s" % \
+                             {'prod' :  product_name, 'error': str(e) })
+                         sys.stdout.write(msg)
+             
+             merger.merge(cfg, products_cfg)
+             
+             # apply overwrite from command line if needed
+             for rule in self.get_command_line_overrides(options, ["PRODUCTS"]):
+                 exec('cfg.' + rule) # this cannot be factorized because of the exec
+             
              if do_merge:
                  merger.merge(cfg, application_cfg)
-             
+                 # default launcher name ('salome')
+                 if ('profile' in cfg.APPLICATION and 
+                     'launcher_name' not in cfg.APPLICATION.profile):
+                     cfg.APPLICATION.profile.launcher_name = 'salome'
                  # apply overwrite from command line if needed
                  for rule in self.get_command_line_overrides(options,
                                                               ["APPLICATION"]):
@@@ -592,22 -595,7 +591,21 @@@ def show_product_info(config, name, log
          src.printcolors.print_value(logger, 
                                      "optional", 
                                      ', '.join(pinfo.opt_depend), 2)
-                                     
 +    # information on pyconf
 +    logger.write("\n", 2)
 +    logger.write(src.printcolors.printcLabel("configuration:") + "\n", 2)
 +    if "from_file" in pinfo:
 +        src.printcolors.print_value(logger, 
 +                                    "pyconf file path", 
 +                                    pinfo.from_file, 
 +                                    2)
 +    if "section" in pinfo:
 +        src.printcolors.print_value(logger, 
 +                                    "section", 
 +                                    pinfo.section, 
 +                                    2)
-     
 +
      # information on prepare
      logger.write("\n", 2)
      logger.write(src.printcolors.printcLabel("prepare:") + "\n", 2)
diff --cc complete_sat.sh
Simple merge