def add_results(self, results): """ Take a list of xresults and add them to the testset. """ for i in results: if i == "": return False else: res = pylib_eprot.eresult(i.res_str()) self.strats.add_result(i.strat, res) return True
def decode_result(decoder, stratset, filename): """ Parse a result file and insert it into stratset. Return true on success, false otherwise. """ resstr = read_res_file(filename) if resstr: try: sname, pname = decode_res_name(filename) except TypeError: return False strat = stratset.find_strat(sname) maxtime = strat.spec.time_limit res = pylib_eprot.eresult(pname+" "+decoder.encode_result(resstr,maxtime)) if res: strat.add_result(res) return True return False else: return False
def decode_results(decoder, stratset, filename): """ Parse a batch result file and insert the results into stratset. """ resstr = read_res_file(filename) if resstr: reslist = resstr.split(ejobhead_str) for i in reslist[1:]: try: filename, rest = i.split("\n", 1) filename = filename.strip() sname, pname = decode_res_name(filename) strat = stratset.find_strat(sname) maxtime = strat.spec.time_limit res = pylib_eprot.eresult(pname+" "+decoder.encode_result(rest,maxtime)) if res: strat.add_result(res) except ValueError: pass return True else: return False