Salome HOME
integration patch pour version windows
[tools/sat.git] / src / __init__.py
index ca569a05d6a89c5f85857af4e7e7a1dfbab07376..ad0997b4f816e1c0aa5ecc563f02250cc5bd816c 100644 (file)
@@ -91,6 +91,27 @@ def check_config_has_profile( config, details = None ):
             details.append(message)
         raise SatException( message )
 
+def appli_test_property(config,property_name, property_value):
+    """Generic function to test if an application has a property set to a value
+    :param config class 'common.pyconf.Config': The config.
+    :param property_name : The name of the property to check
+    :param property_value : The value of the property to test
+    :return: True if the application has the property set to property_value
+    :rtype: boolean
+    """
+    # first check if application has property_value
+    if not ("APPLICATION"  in config and
+            "properties"   in config.APPLICATION and
+            property_name  in config.APPLICATION.properties):
+        return False
+
+    # then check to the property is set to property_value
+    eval_expression = 'config.APPLICATION.properties.%s == "%s"' %\
+                      (property_name,property_value)
+    result = eval(eval_expression)
+    return result
+    
+
 def config_has_application( config ):
     return 'APPLICATION' in config
 
@@ -234,15 +255,8 @@ def get_salometool_version(config):
    :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
+   return config.LOCAL.tag
+
 
 def get_salome_version(config):
     import versionMinorMajorPatch as VMMP