Salome HOME
Merge branch 'nct/jan21' of https://codev-tuleap.cea.fr/plugins/git/salome/sat into...
[tools/sat.git] / commands / run.py
index fe3fd9b68a30caea18a18c0adbf33cceb75f2f56..c6138e5087e18db34ab8fb1fbb3021dc15102e87 100644 (file)
@@ -21,6 +21,9 @@ import subprocess
 
 import src
 
+# Define all possible option for log command :  sat run <options>
+parser = src.options.Options()
+# no option more than -h as generic default
 
 def description():
     '''method that is called when salomeTools is called with --help option.
@@ -28,8 +31,12 @@ def description():
     :return: The text to display for the run command description.
     :rtype: str
     '''
-    return _("This command runs the application launcher"
-             " with the given arguments.\n\nexample:\nsat run SALOME-master")
+    return _("""\
+The run command runs the application launcher with the given arguments.
+
+example:
+>> sat run SALOME-master
+""")
 
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with run parameter.
@@ -38,22 +45,17 @@ def run(args, runner, logger):
     # check for product
     src.check_config_has_application(runner.cfg)
 
-    # check for profile
-    src.check_config_has_profile(runner.cfg)
-
     # Determine launcher path 
-    launcher_name = runner.cfg.APPLICATION.profile.launcher_name
+    launcher_name = src.get_launcher_name(runner.cfg)
     launcher_dir = runner.cfg.APPLICATION.workdir
     
     # Check the launcher existence
     if launcher_name not in  os.listdir(launcher_dir):
-        profile_name = runner.cfg.APPLICATION.profile.module
-        profile_install_dir = src.product.get_product_config(runner.cfg,
-                                                    profile_name).install_dir
-        launcher_dir = os.path.join(profile_install_dir, 'bin', 'salome')
+        message = _("The launcher %s was not found in directory %s!\nDid you run the"
+                    " command 'sat launcher' ?\n") % (launcher_name, launcher_dir)
+        raise src.SatException(message)
           
     launcher_path = os.path.join(launcher_dir, launcher_name)
-    launcher_path = os.path.abspath(launcher_path)
 
     if not os.path.exists(launcher_path):
         message = _("The launcher at path %s is missing.\nDid you run the"