sort out short names in csv files
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 17 May 2021 23:30:47 +0000 (00:30 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 17 May 2021 23:30:47 +0000 (00:30 +0100)
src/budget_sync/budget_graph.py
src/budget_sync/main.py

index 164bd0a57791dceef340f612acc732af2a0a454c..c9319f9f6ea405c51daeef6fdc1a093bdeae45ce 100644 (file)
@@ -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):
index 53842058c4e73eebe7f8e2f0f0acd54b88e530ee..292c449a28bebe03b7d4f9b6552e105abf666436 100644 (file)
@@ -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: