From: Jacob Lifshay Date: Mon, 3 Oct 2022 22:50:33 +0000 (-0700) Subject: format code X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fe217eb9b826021170a381250e14d0c01e5b1236;p=utils.git format code --- diff --git a/src/budget_sync/main.py b/src/budget_sync/main.py index b441acf..3f8c996 100644 --- a/src/budget_sync/main.py +++ b/src/budget_sync/main.py @@ -48,7 +48,7 @@ def main(): except (IOError, ConfigParseError) as e: logging.error("Failed to parse config file: %s", e) return - print ("```") # for using the output as markdown + print("```") # for using the output as markdown logging.info("Using Bugzilla instance at %s", config.bugzilla_url) bz = Bugzilla(config.bugzilla_url) if args.username: @@ -150,7 +150,7 @@ def summarize_milestones(budget_graph: BudgetGraph): milestone.canonical_bug_id) print() - print ("```") # for using the output as markdown + print("```") # for using the output as markdown def json_milestones(budget_graph: BudgetGraph, add_comments: bool, @@ -172,7 +172,7 @@ def json_milestones(budget_graph: BudgetGraph, add_comments: bool, # include the task itself as a milestone for st in list(child.children()) + [child]: amount = st.fixed_budget_excluding_subtasks.int() - if amount == 0: # skip anything at zero + if amount == 0: # skip anything at zero continue # if "task itself" then put the milestone as "wrapup" if st.bug == child.bug: @@ -187,9 +187,9 @@ def json_milestones(budget_graph: BudgetGraph, add_comments: bool, description += "\n(Sub-sub-task of %d)" % parent_id task = {'description': description, 'amount': amount, - } + } #mou_bug = st.closest_bug_in_mou - #if mou_bug is not None: + # if mou_bug is not None: # task['mou_task'] = mou_bug.bug.id milestones.append(task) # create MoU task: get comment #0 @@ -206,23 +206,22 @@ def json_milestones(budget_graph: BudgetGraph, add_comments: bool, 'amount': child.fixed_budget_including_subtasks.int(), 'url': "{{ %s }} " % child.bug_url, 'milestones': milestones - } + } tasks.append(task) d = {'participants': ppl, 'preamble': '', 'type': 'Group', 'url': canonical.bug_url, - 'plan': { 'intro': [''], - 'tasks': tasks, - 'rfp_secret': '', - } + 'plan': {'intro': [''], + 'tasks': tasks, + 'rfp_secret': '', + } } output_file = output_dir / f"report.{milestone.identifier}.json" output_file.write_text(json.dumps(d, indent=2), encoding="utf-8") - if __name__ == "__main__": main() diff --git a/src/budget_sync/write_budget_markdown.py b/src/budget_sync/write_budget_markdown.py index a6b1689..52cf943 100644 --- a/src/budget_sync/write_budget_markdown.py +++ b/src/budget_sync/write_budget_markdown.py @@ -177,17 +177,17 @@ def _markdown_for_person(person: Person, if payee_state == PayeeState.NotYetSubmitted: display_status_header = "\n## Payment not yet submitted\n" subtotals_msg = ("\nMoU Milestone subtotals for not " - "yet submitted payments\n") + "yet submitted payments\n") elif payee_state == PayeeState.Submitted: display_status_header = ("\n## Submitted to NLNet but " "not yet paid\n") subtotals_msg = ("\nMoU Milestone subtotals for " - "submitted but not yet paid payments\n") + "submitted but not yet paid payments\n") else: assert payee_state == PayeeState.Paid display_status_header = "\n## Paid by NLNet\n" subtotals_msg = ("\nMoU Milestone subtotals for paid " - "payments\n") + "payments\n") # list all the payments grouped by Grant for milestone, payments_list in payments_dict.items(): milestone_header = f"\n### {milestone.identifier}\n"