[Blends-commit] [SCM] blends-gsoc branch, master, updated. d24869bf327ce1d6bc1ad50bc03a6f3ac4b5262e

Emmanouil Kiagias e.kiagias at gmail.com
Fri Aug 30 13:25:52 UTC 2013


The following commit has been merged in the master branch:
commit d24869bf327ce1d6bc1ad50bc03a6f3ac4b5262e
Author: Emmanouil Kiagias <e.kiagias at gmail.com>
Date:   Fri Aug 30 15:25:57 2013 +0200

    added get_priorities() function

diff --git a/devtools/sec-blend-gen-control b/devtools/sec-blend-gen-control
index 99fdf15..86f315f 100755
--- a/devtools/sec-blend-gen-control
+++ b/devtools/sec-blend-gen-control
@@ -625,6 +625,28 @@ class UDD_connector:
                 self.logger.warning(" **Missing package {0} has the following existing versions:".format(packages_keys[pkg_key]))
                 self.logger.warning(", ".join(results[pkg_key]))
 
+
+def get_priorities(priority):
+    logger = logging.getLogger(__name__)
+    
+    prioritylist = []
+
+    # if there is no taskcontrolfile every task has the same priority
+    #thus return an empty prioritylist
+    if not os.path.isfile(TASKCONTROLFILE):
+        logger.debug("No task control file found - setting all tasks priority high.\n")
+
+        return prioritylist
+    
+    # read taskcontrolfile and find priorities
+    logger.debug("Reading task control file.\n")
+    with open(TASKCONTROLFILE,'r') as fin:
+        for line in fin.readlines():
+            if line.startswith(priority):
+                prioritylist.append(line.split(':')[1].strip())
+
+    return prioritylist
+
 def gen_control(**kwargs):
     """
     This method generates the blend's control file using the dataDict which contains 

-- 
Git repository for blends-gsoc code



More information about the Blends-commit mailing list