else:
sstatus = None
- return ((cstatus, bstatus, istatus, tstatus, sstatus), other_failures)
+ return {"config": cstatus, "build": bstatus, "install": istatus,\
+ "test": tstatus, "checker": sstatus, "other": other_failures}
def lcov_extract_percentage(text):
return ret
+ def unmarshall_status(self, cnt):
+ tab = cnt.split('\n')
+ hash = {}
+ for l in tab:
+ tab2 = l.split(':', 1)
+ if tab2[0] == "other":
+ tab3 = []
+ if len(tab2) > 1:
+ tab3 = tab2[1].split('%')
+ hash[tab2[0]] = tab3
+ else:
+ if tab2[1] == "None":
+ hash[tab2[0]] = tab2[1]
+ else:
+ hash[tab2[0]] = None
+
+ return hash
+
+ def marshall_status(self, val):
+ tab = []
+ for k in val.keys():
+ if k != "other":
+ tab.append("%s:%s" % (k, val[k]))
+ else:
+ tab.append("%s:%s" % (k, "%".join(val[k])))
+
+ return "\n".join(tab)
+
def status(self):
file = self._store.build_fname(self.tree, self.host, self.compiler, self.rev)
cachefile = self._store.cache_fname(self.tree, self.host, self.compiler, self.rev)+".status"
st2 = None
if st2 and st1.st_ctime <= st2.st_mtime:
- return util.FileLoad(cachefile)
+ cnt = util.FileLoad(cachefile)
+ return self.unmarshall_status(cnt)
ret = super(CachingBuild, self).status()
if not self._store.readonly:
- util.FileSave(cachefile, ret)
+ cnt = self.marshall_status(ret)
+ util.FileSave(cachefile, cnt)
return ret
def html_build_status(status):
- ((cstatus, bstatus, istatus, tstatus, sstatus), other_failures) = status
+ cstatus = status.get("config")
+ bstatus = status.get("build")
+ istatus = status.get("install")
+ tstatus = status.get("test")
+ sstatus = status.get("checker")
+ other_failures = status.get("other")
def span(classname, contents):
return "<span class=\"%s\">%s</span>" % (classname, contents)