]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
add context file
authorCédric Aguerre <cedric.aguerre@edf.fr>
Thu, 10 Apr 2014 13:26:52 +0000 (15:26 +0200)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Thu, 10 Apr 2014 13:50:42 +0000 (15:50 +0200)
bin/appli_gen.py

index a1d58af082600c06488c5274dc76ad945653ae2f..922a8b6615798cb8f374f3ec69b9b605e279b470 100644 (file)
@@ -41,6 +41,7 @@ import virtual_salome
 # --- names of tags in XML configuration file
 appli_tag   = "application"
 prereq_tag  = "prerequisites"
+context_tag = "context"
 system_conf_tag  = "system_conf"
 modules_tag = "modules"
 module_tag  = "module"
@@ -84,6 +85,10 @@ class xml_parser:
         if self.space == [appli_tag, prereq_tag] and path_att in attrs.getNames():
             self.config["prereq_path"] = attrs.getValue( path_att )
             pass
+        # --- if we are analyzing "context" element then store its "path" attribute
+        if self.space == [appli_tag, context_tag] and path_att in attrs.getNames():
+            self.config["context_path"] = attrs.getValue( path_att )
+            pass
         # --- if we are analyzing "system_conf" element then store its "path" attribute
         if self.space == [appli_tag, system_conf_tag] and path_att in attrs.getNames():
             self.config["system_conf_path"] = attrs.getValue( path_att )
@@ -217,15 +222,21 @@ def install(prefix,config_file,verbose=0):
     else:
         print "WARNING: prerequisite file does not exist"
         pass
-    # :NOTE: For the new launch procedure, we do not use a "physical" .cfg
-    # file for prerequisites; the launch procedure automatically reads and
-    # converts the envProducts.sh file.
+
+    if os.path.isfile(_config["context_path"]):
+        command='cp -p ' + _config["context_path"] + ' ' + os.path.join(home_dir,'env.d','envProducts.cfg')
+        os.system(command)
+        pass
+    else:
+        print "WARNING: context file does not exist"
+        pass
 
     if _config.has_key("system_conf_path") and os.path.isfile(_config["system_conf_path"]):
         command='cp -p ' + _config["system_conf_path"] + ' ' + os.path.join(home_dir,'env.d','envConfSystem.sh')
         os.system(command)
         pass
 
+
     # Create environment file: configSalome.sh
     f =open(os.path.join(home_dir,'env.d','configSalome.sh'),'w')
     for module in _config["modules"]: