From: Luke Kenneth Casson Leighton Date: Mon, 17 May 2021 23:30:47 +0000 (+0100) Subject: sort out short names in csv files X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=08449867bbcc8e5865782d030bba29dba8824493;p=utils.git sort out short names in csv files --- 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: