plan_ts = 0 unplan_ts = 0 es_sum = sum([issue["estimate"] for issue in issues_iter]) for i_upd in issues_upd: wls = jira.getWorkLog(i_upd["key"]) wls = filter(lambda a: a["created"] == yesterday.d_tup, wls) if not wls: continue ts = sum([a["timespent"] for a in wls]) if i_upd in issues_iter: plan_ts += ts else: unplan_ts += ts struct = loadStats(filename) es_sum, plan_ts, unplan_ts = map(formatLogWork, (es_sum, plan_ts, unplan_ts)) struct[today.d_str] = {"es": es_sum, "pl": plan_ts, "un": unplan_ts} dumpStats(filename, struct) pie_data = dict() for i_iter in issues_iter: es = i_iter["estimate"] if not es: continue ow = i_iter["assignee"] if not ow in pie_data.keys(): pie_data[ow] = es else: pie_data[ow] += es pie_data = dict([(a, formatLogWork(b)) for a, b in pie_data.items()])
from lib import Date, getDatesFromRange, loadStats, buildPlot, buildPie from config import * iteration = iters[-1] iter_range = iteration["range"] iter_exc = iteration["exclude"] filename = "%s_%s.yaml" % iter_range data_first, data_last = iter_range all_dates = getDatesFromRange(iter_range) filterstats = lambda a, b: [a[i] for i in range(len(a)) if i not in b] work_dates = filterstats(all_dates, iter_exc) struct = loadStats(filename) pl_sum = un_sum = 0 es_list = list() pl_list = list() un_list = list() to_list = list() de_list = list() for d in all_dates: day_data = struct.get(d) if not day_data: continue es_value = float(day_data["es"]) es_list.append(es_value) pl_sum += float(day_data["pl"]) pl_list.append(pl_sum)