From 7835dba9773092128afa4ef95b828a07541460e0 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 6 Dec 2023 18:46:16 +0000 Subject: [PATCH] use
 not 

---
 src/budget_sync/main.py | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/src/budget_sync/main.py b/src/budget_sync/main.py
index d2828fb..5baa1c3 100644
--- a/src/budget_sync/main.py
+++ b/src/budget_sync/main.py
@@ -18,6 +18,7 @@ from budget_sync.write_budget_markdown import (write_budget_markdown,
 def spc(s):
     return s.replace(" ", " ")
 
+bugurl = "https://bugs.libre-soc.org/show_bug.cgi?bug="
 
 def main():
     parser = argparse.ArgumentParser(
@@ -59,7 +60,7 @@ def main():
     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
+        print("
", file=f)  # for using the output as markdown
         bz = Bugzilla(config.bugzilla_url)
         if args.username:
             logging.debug("logging in...")
@@ -79,7 +80,7 @@ def main():
             write_budget_markdown(budget_graph, args.output_dir)
             write_budget_csv(budget_graph, args.output_dir)
         summarize_milestones(f, budget_graph, detail=args.detail)
-        print("", file=f)  # for using the output as markdown
+        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) @@ -124,14 +125,16 @@ def print_budget_then_children(f, indent, nodes, bug_id, detail=False): excl_desc = " " if b_incl != b_excl: excl_desc = "excltasks %6s" % b_excl - print(spc("bug #%5d %s budget %6s %s %s
" % - (bug.bug.id, ' | ' * indent, + bugid = spc("%5d" % bug.bug.id) + buglink = "%s" % (bugurl, bug.bug.id, bugid) + print(spc("bug #URL %s budget %6s %s %s" % + (' | ' * indent, b_incl, excl_desc, descr - )), file=f) + )).replace("URL", buglink), file=f) if detail: - print(spc(" %s | (%s)
" % + print(spc(" %s | (%s)" % (' | ' * indent, bug.bug.summary[:40] )), file=f) @@ -147,28 +150,28 @@ def print_budget_then_children(f, indent, nodes, bug_id, detail=False): def summarize_milestones(f, budget_graph, detail=False): for milestone, payments in budget_graph.milestone_payments.items(): summary = PaymentSummary(payments) - print(f"{milestone.identifier}
", file=f) + print(f"{milestone.identifier}", file=f) print(f" {summary.total} submitted: " - f"{summary.total_submitted} paid: {summary.total_paid}
", + f"{summary.total_submitted} paid: {summary.total_paid}", file=f) not_submitted = summary.get_not_submitted() if not_submitted: - print("not submitted %s
" % not_submitted, file=f) + print("not submitted %s" % not_submitted, file=f) # and one to display people for person in budget_graph.milestone_people[milestone]: - print(spc(" %-30s - %s
" % (person.identifier, + print(spc(" %-30s - %s" % (person.identifier, person.full_name)), file=f) - print("
", file=f) + print("", file=f) # now do trees for milestone, payments in budget_graph.milestone_payments.items(): - print("%s %d
" % (milestone.identifier, milestone.canonical_bug_id), + print("%s %d" % (milestone.identifier, milestone.canonical_bug_id), file=f) print_budget_then_children(f, 0, budget_graph.nodes, milestone.canonical_bug_id, detail) - print("
", file=f) + print("", file=f) def json_milestones(budget_graph: BudgetGraph, add_comments: bool, -- 2.30.2