commit cd4ff7d3e3cb5e290731ae02fdac95f7c1e4c6bb
parent 25335b5147c47f618a38bf0cf7d465925254a240
Author: parazyd <parazyd@dyne.org>
Date: Wed, 3 Mar 2021 10:15:06 +0100
Fix constant and print exception error if there is one.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ticker.py b/ticker.py
@@ -44,7 +44,7 @@ font_date = ImageFont.truetype(join(fontdir, 'PixelSplitter-Bold.ttf'), 11)
currency = 'usd'
coin = 'bitcoin'
-tokenfilename = join(picdir, 'currency/%s.bmp' % currency)
+tokenfilename = join(picdir, 'currency/%s.bmp' % coin)
athbitmap = Image.open(join(picdir, 'ATH.bmp'))
tokenimage = Image.open(tokenfilename)
@@ -68,8 +68,8 @@ def get_data(other):
try:
timeseriesarray = requests.get(url_hist).json()['prices']
- except JSONDecodeError:
- print('Caught JSONDecodeError')
+ except JSONDecodeError as err:
+ print(f'Caught JSONDecodeError: {repr(err)}')
return None
timeseriesstack = []
length = len(timeseriesarray)