summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2021-09-20 22:02:29 +0500
committerAnton Bobov <abobov@gmail.com>2021-09-20 22:02:29 +0500
commitc83690911af9326784d81e49e2b55de9688c1e9b (patch)
treeb12a0bfe031501cf0c30b7bf5d45039644b13ecd
parentf563df749c7638ac3c7d82ae6ab48895581c10b9 (diff)
Ledger price only if not empty.
-rwxr-xr-xledger-price-db-update.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ledger-price-db-update.py b/ledger-price-db-update.py
index 1ab1d4f..eed54bc 100755
--- a/ledger-price-db-update.py
+++ b/ledger-price-db-update.py
@@ -49,7 +49,8 @@ def print_price(symbol, price, base, date=datetime.datetime.now()):
date_str = date.strftime('%Y/%m/%d %H:%M:%S')
if ' ' in symbol:
symbol = '"' + symbol + '"'
- print(('P %s %s %f %s' % (date_str, symbol, price, base)))
+ if price:
+ print(('P %s %s %f %s' % (date_str, symbol, price, base)))
def exchange_rates():