From 2edc1883b2b62327516d91f8cdaac939570c3384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 14 May 2015 17:37:18 +0200 Subject: Fix booting process and test target Test target wasn't working properly. Now it should work. --- scripts/utils.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'scripts/utils.py') diff --git a/scripts/utils.py b/scripts/utils.py index 0b6ac9c..060aa3e 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -114,3 +114,32 @@ def config_strtoint(str): except ValueError: pass return rtn + +def get_config_from_hash(hash): + with open(sf(conf.config_map_file), "r") as f: + for line in f: + w = line.rstrip().split(sep=':') + if w[0] == hash: + return config_strtoint(w[1]) + return None + +def get_last_configuration(): + hsh = "" + try: + with open(sf(conf.config_solved_file), "r") as f: + for line in f: + sline = line.rstrip() + if sline != '': + hsh = sline + except FileNotFoundError: + try: + with open(sf(conf.config_map_file), "r") as f: + w = f.readline().split(sep=':') + hsh = w[0] + except FileNotFoundError: + pass + + if hsh != '': + return hsh + else: + return 'NoConfig' -- cgit v1.2.3