Salome HOME
sat #20391 : changement API Exception methode message
[tools/sat.git] / src / __init__.py
index ad0997b4f816e1c0aa5ecc563f02250cc5bd816c..95bd104faf73f075ba1173a6acd339d9d20efbac 100644 (file)
@@ -55,8 +55,13 @@ KNOWNFAILURE_STATUS = "KF"
 TIMEOUT_STATUS = "TIMEOUT"
 
 class SatException(Exception):
-    """rename Exception Class"""
-    pass
+    """sat exception class"""
+    def message(self, arg):
+        if sys.version_info[0] >= 3:
+            # message method is not available for python 3.8+
+            return super().msg(arg)
+        else:
+            return super(SatException,self).message(arg)
 
 def ensure_path_exists(p):
     """Create a path if not existing
@@ -230,6 +235,23 @@ def get_launcher_name(config):
 
     return launcher_name
 
+def get_launcher_exe(config):
+    """\
+    Returns the name of exe defined in profile section.
+    
+    :param config Config: The global Config instance.
+    :return: The name of the exe to use in launcher.
+    :rtype: str
+    """
+    check_config_has_application(config)
+    if 'profile' in config.APPLICATION and 'exe' in config.APPLICATION.profile:
+        exe_name = config.APPLICATION.profile.exe
+    else:
+        exe_name = None
+
+    return exe_name
+
+
 def get_log_path(config):
     """\
     Returns the path of the logs.