import logging
import argparse
from pathlib import Path
+from budget_sync.money import Money
from budget_sync.util import all_bugs
from budget_sync.config import Config, ConfigParseError, Milestone
from budget_sync.budget_graph import BudgetGraph, BudgetGraphBaseError, PaymentSummary
summarize_milestones(budget_graph)
+def print_budget_then_children(indent, nodes, bug_id):
+ """recursive indented printout of budgets
+ """
+
+ bug = nodes[bug_id]
+ print("bug #%5d %s budget %7s excltasks %7s" % \
+ (bug.bug.id, ' ' * (indent*4),
+ str(bug.budget_including_subtasks),
+ str(bug.budget_excluding_subtasks)))
+ #print (repr(bug))
+ for child in bug.immediate_children:
+ if (str(child.budget_including_subtasks) == "0" and
+ str(child.budget_excluding_subtasks) == "0"):
+ continue
+ print_budget_then_children(indent+1, nodes, child.bug.id)
+
+
def summarize_milestones(budget_graph: BudgetGraph):
for milestone, payments in budget_graph.milestone_payments.items():
summary = PaymentSummary(payments)
print(f"\t{person.identifier}")
print()
+ # now do trees
+ for milestone, payments in budget_graph.milestone_payments.items():
+ print("%s %d" % (milestone.identifier, milestone.canonical_bug_id))
+ print_budget_then_children(0, budget_graph.nodes,
+ milestone.canonical_bug_id)
+ print()
if __name__ == "__main__":
main()