From a99cceadadfba3d9ac61dd9bb9e392db9e0b774a Mon Sep 17 00:00:00 2001 From: Justus Pendleton Date: Sun, 5 Jan 2025 07:57:31 +1030 Subject: [PATCH] Only print table header if there are actually accounts that need updates. --- beancount_reds_importers/util/needs_update.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beancount_reds_importers/util/needs_update.py b/beancount_reds_importers/util/needs_update.py index ed61da7..7e7ad32 100755 --- a/beancount_reds_importers/util/needs_update.py +++ b/beancount_reds_importers/util/needs_update.py @@ -166,7 +166,8 @@ def accounts_needing_updates(beancount_file, recency, sort_by_date, all_accounts for acc, bal in d.items() if ((datetime.now().date() - d[acc].date).days > recency) } - pretty_print_table(need_updates, sort_by_date) + if need_updates: + pretty_print_table(need_updates, sort_by_date) # If there are accounts with zero balance entries, print them accs_no_bal = accounts_with_no_balance_entries(entries, closes, last_balance)