From 0ac54c5b12a7bd5c2cf50bbaa150bc8c83171b71 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 9 Dec 2021 13:53:53 +0000 Subject: [PATCH] provide print-out method without update for bugs --- src/budget_sync/update.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/budget_sync/update.py b/src/budget_sync/update.py index cfc74a5..15b6f0c 100644 --- a/src/budget_sync/update.py +++ b/src/budget_sync/update.py @@ -48,7 +48,7 @@ def main(): buglist = bz.getbugs(bugs) logging.info("got bugs %s" % args.bug) for bug in buglist: - print ("payees", bug.cf_payees_list) + print ("payees", bug.id, bug.cf_payees_list) parsed_toml = toml.loads(bug.cf_payees_list) print (parsed_toml) @@ -57,14 +57,22 @@ def main(): if isinstance(payee, int): payee = {'amount': payee} + modified = False + if args.submitted and 'submitted' not in payee: + modified = True d = datetime.strptime(args.submitted, "%Y-%m-%d") payee['submitted'] = date(d.year, d.month, d.day) if args.paid and 'paid' not in payee: + modified = True d = datetime.strptime(args.paid, "%Y-%m-%d") payee['paid'] = date(d.year, d.month, d.day) + # skip over not modified + if not modified: + continue + parsed_toml[args.user] = payee encoder = toml.encoder.TomlPreserveInlineDictEncoder() -- 2.30.2