write_budget_markdown(budget_graph, args.output_dir)
write_budget_csv(budget_graph, args.output_dir)
summarize_milestones(budget_graph)
- json_milestones(budget_graph, args.comments)
+ json_milestones(budget_graph, args.comments, args.output_dir)
def print_markdown_for_person(budget_graph: BudgetGraph, config: Config,
print ("```") # for using the output as markdown
-def json_milestones(budget_graph, add_comments):
+def json_milestones(budget_graph: BudgetGraph, add_comments: bool,
+ output_dir: Path):
"""reports milestones as json format
"""
for milestone, payments in budget_graph.milestone_payments.items():
comments = child.bug.getcomments()
comment += "\n%s" % comments[0]['text']
intro.append(comment)
- #print (description, intro)
- sys.stdout.flush()
+ # print (description, intro)
+ # sys.stdout.flush()
task = {'title': "%d %s" % (child.bug.id, child.bug.summary),
'intro': intro,
'amount': child.fixed_budget_including_subtasks.int(),
}
}
- with open("report.%s.json" % milestone.identifier, "w") as f:
- json.dump(d, f, indent=2)
+ output_file = output_dir / f"report.{milestone.identifier}.json"
+ output_file.write_text(json.dumps(d, indent=2), encoding="utf-8")