diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2012-10-30 16:32:02 +0000 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2012-10-30 16:32:02 +0000 |
commit | c9789a587012558b380cd56bab06b0498b552421 (patch) | |
tree | e21669d2070e549c384863a2a73a68c369e098c9 | |
parent | b6bcacd137803e0fe2ae568e3bdd066e1f774242 (diff) | |
download | lorry-controller-c9789a587012558b380cd56bab06b0498b552421.tar.gz |
Fix up bugs in conf parsing
-rw-r--r-- | lorrycontroller/confparser.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lorrycontroller/confparser.py b/lorrycontroller/confparser.py index e24db07..c6acf29 100644 --- a/lorrycontroller/confparser.py +++ b/lorrycontroller/confparser.py @@ -151,7 +151,7 @@ class LorryControllerConfig(object): endtime = starttime + entry['interval-parsed'] step = 0 if entry['stagger']: - step = (endtime - starttime) / len(my_lorry_names) + step = (endtime - starttime) / (len(my_lorry_names) + 1) for lorry_name in my_lorry_names: self.duetimes[lorry_name] = starttime starttime += step @@ -201,6 +201,8 @@ class LorryControllerConfig(object): if exit == 0: repo_info = {} for entry in [x for x in out.split("\n") if x != ""]: + while entry.find(" ") > -1: + entry = entry.replace(" ", " ") elems = entry.split(" ") this_repo = { "perm": elems[0], @@ -257,7 +259,7 @@ class LorryControllerConfig(object): endtime = starttime + trove['interval-parsed'] step = 0 if trove['stagger']: - step = (endtime - starttime) / len(lorries_made) + step = (endtime - starttime) / (len(lorries_made)+1) for lorry_name in lorries_made: self.duetimes[lorry_name] = starttime starttime += step |