From 08449867bbcc8e5865782d030bba29dba8824493 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 18 May 2021 00:30:47 +0100 Subject: [PATCH] sort out short names in csv files --- src/budget_sync/budget_graph.py | 4 +++- src/budget_sync/main.py | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/budget_sync/budget_graph.py b/src/budget_sync/budget_graph.py index 164bd0a..c9319f9 100644 --- a/src/budget_sync/budget_graph.py +++ b/src/budget_sync/budget_graph.py @@ -808,7 +808,9 @@ class BudgetGraph: retval[milestone] = OrderedSet() for milestone, payments in self.milestone_payments.items(): for payment in payments: - retval[milestone].add(str(payment.payee.identifier)) + short_name = str(payment.payee.output_markdown_file) + short_name = short_name.replace(".mdwn", "") + retval[milestone].add(short_name) return retval def __repr__(self): diff --git a/src/budget_sync/main.py b/src/budget_sync/main.py index 5384205..292c449 100644 --- a/src/budget_sync/main.py +++ b/src/budget_sync/main.py @@ -101,7 +101,7 @@ def main(): name = str(person).replace(" ", "_") all_people[person] = person # name, amount, requested (submitted), paid - headings.append(name+"_amount") + headings.append(name) headings.append(name+"_req") headings.append(name+"_paid") milestone_headings[milestone] = headings @@ -111,8 +111,10 @@ def main(): if row is None: row = {'bug_id': payment.node.bug.id} - name = str(payment.payee.identifier).replace(" ", "_") - row[name+"_amount"] = str(payment.amount) + short_name = str(payment.payee.output_markdown_file) + name = short_name.replace(".mdwn", "") + + row[name] = str(payment.amount) if payment.submitted is not None: requested = str(payment.submitted) else: -- 2.30.2