logging.error("Failed to parse config file: %s", e)
return
logging.info("Using Bugzilla instance at %s", config.bugzilla_url)
- f = open("/tmp/report.mdwn", "w")
- print("```", file=f) # for using the output as markdown
- bz = Bugzilla(config.bugzilla_url)
- if args.username:
- logging.debug("logging in...")
- bz.interactive_login(args.username, args.password)
- logging.debug("Connected to Bugzilla")
- budget_graph = BudgetGraph(all_bugs(bz), config)
- for error in budget_graph.get_errors():
- logging.error("%s", error)
- if args.person or args.subset:
- if not args.person:
- logging.fatal("must use --subset-person with --subset option")
- sys.exit(1)
- print_markdown_for_person(f, budget_graph, config,
- args.person, args.subset)
- return
- if args.output_dir is not None:
- write_budget_markdown(budget_graph, args.output_dir)
- write_budget_csv(budget_graph, args.output_dir)
- summarize_milestones(f, budget_graph)
- print("```", file=f) # for using the output as markdown
+ # download all bugs and create a summary report
+ reportdir = "./" if args.output_dir is None else str(args.output_dir)
+ reportdir = "/".join(reportdir.split("/")[:-1]) # strip /mdwn
+ reportname = reportdir + "/report.mdwn"
+ with open(reportname, "w") as f:
+ print("```", file=f) # for using the output as markdown
+ bz = Bugzilla(config.bugzilla_url)
+ if args.username:
+ logging.debug("logging in...")
+ bz.interactive_login(args.username, args.password)
+ logging.debug("Connected to Bugzilla")
+ budget_graph = BudgetGraph(all_bugs(bz), config)
+ for error in budget_graph.get_errors():
+ logging.error("%s", error)
+ if args.person or args.subset:
+ if not args.person:
+ logging.fatal("must use --subset-person with --subset option")
+ sys.exit(1)
+ print_markdown_for_person(f, budget_graph, config,
+ args.person, args.subset)
+ return
+ if args.output_dir is not None:
+ write_budget_markdown(budget_graph, args.output_dir)
+ write_budget_csv(budget_graph, args.output_dir)
+ summarize_milestones(f, budget_graph)
+ print("```", file=f) # for using the output as markdown
+ # now create the JSON milestone files for putting into NLnet RFP system
json_milestones(budget_graph, args.comments, args.output_dir)