def add_result(self, date, res): p = result.personlister() people = p.get(res) s = result.score_getter() ss = result.score_valuer() score = ss.get(s.get(res)) for person in people: if not person in self.people.keys(): self.people[person] = [] self.people[person].append( (date, score) )
def newcomp(self, comp): minscore = 0 maxscore = 0 val = result.score_valuer() res = result.score_getter() for i in comp.results: s = val.get(res.get(i)) if s < minscore: minscore = s if s > maxscore: maxscore = s if maxscore == minscore: self.m = 0 else: self.m = self.bar_width / (maxscore - minscore)
def output(meetings, people): s = result.score_getter() meetings.sort() for name,entries in people.iteritems(): f = file("output/history_csv_per_person/" + name + ".csv", "w") entries.sort(lambda a, b: cmp(a[1], b[1]) or cmp(a[0], b[0])) for m in meetings: f.write("," + m) comp = "" mpos = 0 for e in entries: if comp != e[1]: mpos = 0 comp = e[1] f.write("\n" + comp + ",") while meetings[mpos] != e[0]: mpos = mpos + 1 f.write(",") f.write(str(s.get(e[2]))) f.close()