format code
authorJacob Lifshay <programmerjake@gmail.com>
Mon, 3 Oct 2022 22:50:33 +0000 (15:50 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Mon, 3 Oct 2022 22:50:33 +0000 (15:50 -0700)
src/budget_sync/main.py
src/budget_sync/write_budget_markdown.py

index b441acfbbd703224ac015263499125cdb710fd0c..3f8c9963ae1b7add74dfbb7810950f830cd0cc5c 100644 (file)
@@ -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()
index a6b1689ac1a26f9551cf60a902c4e48920ec4fb5..52cf9430dc3f58a824455c7e6c606bf1ffb41ead 100644 (file)
@@ -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"