Salome HOME
sat #8581 : ajout d'une fonctionnalité de description fine de la version de salomeToo...
[tools/sat.git] / src / __init__.py
index 02f27a6e521a8ae290942c1331fa2c4c930b1bd2..ca569a05d6a89c5f85857af4e7e7a1dfbab07376 100644 (file)
@@ -228,6 +228,22 @@ def get_log_path(config):
     
     return log_dir_path
 
+def get_salometool_version(config):
+   """Return the salomeTool version.
+
+   :param config Config: The global Config instance.
+   :return: the description of this version of sat in terms of tag and commit
+   """
+   # we use : 
+   # config.VARS.salometoolsway : the full path of salomeTool
+   # config.INTERNAL.sat_version : the static salomeTool version, 
+   # in case we are not in a git repo  
+   sat_version=system.git_describe(config.VARS.salometoolsway) 
+   if sat_version == False:
+       return config.INTERNAL.sat_version
+   else:
+       return sat_version
+
 def get_salome_version(config):
     import versionMinorMajorPatch as VMMP