Salome HOME
sat job: be able to pass global options to a specific command (sat -o ... command)
[tools/sat.git] / commands / launcher.py
index a353a6719e5f3335a4d2e1cd5c58975fcec8fbd0..3367535aa604b85f01d8997276477dfdb9cba4ed 100644 (file)
@@ -27,12 +27,13 @@ import src
 \r
 parser = src.options.Options()\r
 \r
-parser.add_option('n', 'name', 'string', 'name', _('The name of the launcher '\r
-                            '(default is APPLICATION.profile.launcher_name)'))\r
+parser.add_option('n', 'name', 'string', 'name', _('Optional: The name of the'\r
+                            ' launcher (default is '\r
+                            'APPLICATION.profile.launcher_name)'))\r
 parser.add_option('c', 'catalog', 'string', 'catalog',\r
-    _('The resources catalog to use'))\r
+    _('Optional: The resources catalog to use'))\r
 parser.add_option('', 'gencat', 'string', 'gencat',\r
-    _("Create a resources catalog for the specified machines "\r
+    _("Optional: Create a resources catalog for the specified machines "\r
       "(separated with ',') \n\tNOTICE: this command will ssh to retrieve"\r
       " information to each machine in the list"))\r
 \r
@@ -96,7 +97,7 @@ def generate_launch_file(config,
         # Write the launcher file\r
         logger.write(_("Generating launcher for %s :\n") % \r
                      src.printcolors.printcLabel(config.VARS.application), 1)\r
-        logger.write("  %s\n" %src.printcolors.printcLabel(filepath), 1)\r
+        logger.write("  %s\n" % src.printcolors.printcLabel(filepath), 1)\r
     \r
     # open the file and write into it\r
     launch_file = open(filepath, "w")\r
@@ -349,7 +350,8 @@ def finish_profile_install(config, launcherPath):
 ##\r
 # Describes the command\r
 def description():\r
-    return _("The launcher command generates a salome launcher.")\r
+    return _("The launcher command generates a SALOME launcher.\n\nexample:"\r
+             "\nsat launcher SALOME-master")\r
 \r
 ##\r
 # Runs the command.\r
@@ -364,6 +366,15 @@ def run(args, runner, logger):
     # Verify that the APPLICATION section has a profile section\r
     src.check_config_has_profile( runner.cfg )\r
 \r
+    # Verify that the profile is installed\r
+    if not src.product.check_installation(\r
+                                src.product.get_product_config(\r
+                                    runner.cfg,\r
+                                    runner.cfg.APPLICATION.profile.product)):\r
+        msg = _("The profile of the application is not correctly installed.")\r
+        logger.write(src.printcolors.printcError(msg), 1)\r
+        return 1\r
+\r
     # Change the name of the file to create \r
     # if the corresponding option was called\r
     if options.name:\r