diff --git a/python/plugins/processing/tests/AlgorithmsTestBase.py b/python/plugins/processing/tests/AlgorithmsTestBase.py index 7a165c3c7a7..db327872aec 100644 --- a/python/plugins/processing/tests/AlgorithmsTestBase.py +++ b/python/plugins/processing/tests/AlgorithmsTestBase.py @@ -54,6 +54,8 @@ class AlgorithmsTest: """ This is the main test function. All others will be executed based on the definitions in testdata/algorithm_tests.yaml """ + ver = processing.version() + print "Processing {}.{}.{}".format(ver / 10000, ver / 100 % 100, ver % 100) with open(os.path.join(processingTestDataPath(), self.test_definition_file()), 'r') as stream: algorithm_tests = yaml.load(stream) diff --git a/python/plugins/processing/tools/general.py b/python/plugins/processing/tools/general.py index fa9f4b77e0f..2a642164de6 100644 --- a/python/plugins/processing/tools/general.py +++ b/python/plugins/processing/tools/general.py @@ -25,6 +25,9 @@ __copyright__ = '(C) 2013, Victor Olaya' __revision__ = '$Format:%H$' +import os +import ConfigParser + from processing.core.Processing import Processing from processing.gui.Postprocessing import handleAlgorithmResults from processing.core.parameters import ParameterSelection @@ -75,3 +78,11 @@ def runalg(algOrName, *args, **kwargs): def runandload(name, *args, **kwargs): return Processing.runAlgorithm(name, handleAlgorithmResults, *args, **kwargs) + + +def version(): + pluginPath = os.path.split(os.path.dirname(__file__))[0] + cfg = ConfigParser.SafeConfigParser() + cfg.read(os.path.join(pluginPath, 'metadata.txt')) + ver = cfg.get('general', 'version').split('.') + return 10000 * int(ver[0]) + 100 * int(ver[1]) + int(ver[2])