Salome HOME
unification des launcher python et exe, pour passage au mode exe du lanceur salome
[tools/sat.git] / commands / environ.py
index a552fddf0aa609d77e637f08ee8dc23fa23a4e49..7b2676354df69d4307767c47b49a5bfd55cbdbd9 100644 (file)
@@ -23,7 +23,7 @@ import src
 parser = src.options.Options()
 parser.add_option('', 'shell', 'list2', 'shell',
     _("Optional: Generates the environment files for the given format: "
-      "bash (default), bat (for windows) or all."), [])
+      "bash (default), bat (for windows), cfg (salome context file) or all."), [])
 parser.add_option('p', 'products', 'list2', 'products',
     _("Optional: Includes only the specified products."))
 parser.add_option('', 'prefix', 'string', 'prefix',
@@ -34,8 +34,8 @@ parser.add_option('t', 'target', 'string', 'out_dir',
     None)
 
 # list of available shells with extensions
-C_SHELLS = { "bash": "sh", "bat": "bat" }
-C_ALL_SHELL = [ "bash", "bat" ]
+C_SHELLS = { "bash": "sh", "bat": "bat", "cfg" : "cfg", "tcl" : ""}
+C_ALL_SHELL = [ "bash", "bat", "cfg", "tcl" ]
 
 
 ##
@@ -100,15 +100,22 @@ def write_all_source_files(config,
     for_build = True
     for_launch = False
     for shell in shells_list:
-        files.append(writer.write_env_file("%s_launch.%s" %
-                                           (prefix, shell.extension),
-                                           for_launch,
-                                           shell.name))
-        files.append(writer.write_env_file("%s_build.%s" %
-                                           (prefix, shell.extension),
-                                           for_build,
-                                           shell.name))
+        if shell.name=="tcl":
+            files.append(writer.write_tcl_files(for_launch,
+                                                shell.name))
+        else:
+            files.append(writer.write_env_file("%s_launch.%s" %
+                                               (prefix, shell.extension),
+                                               for_launch,
+                                               shell.name))
+            files.append(writer.write_env_file("%s_build.%s" %
+                                               (prefix, shell.extension),
+                                               for_build,
+                                               shell.name))
 
+    for f in files:
+        if f:
+            logger.write("    "+f+"\n", 3)
     return files
 
 ##################################################