From ae67498e753a09e89b02b7f1fa90612a402caf82 Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 23 Dec 2019 11:47:37 -0500 Subject: [PATCH 1/2] qrz: handle addresses that are only whitespace Fixes #124 --- exts/qrz.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exts/qrz.py b/exts/qrz.py index b180049..3ab6858 100644 --- a/exts/qrz.py +++ b/exts/qrz.py @@ -71,6 +71,7 @@ class QRZCog(commands.Cog): embed.set_thumbnail(url=resp_data['image']) data = qrz_process_info(resp_data) + print(data) for title, val in data.items(): if val is not None: @@ -139,6 +140,9 @@ def qrz_process_info(data: dict): state = '' address = data.get('addr1', '') + '\n' + data.get('addr2', '') + \ state + ' ' + data.get('zip', '') + address = address.strip() + if address == '': + address = None if 'eqsl' in data: eqsl = 'Yes' if data['eqsl'] == 1 else 'No' else: From e9d2274e6402eecf33fcd322961785f0db7104b7 Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 23 Dec 2019 11:49:55 -0500 Subject: [PATCH 2/2] remove print statement --- exts/qrz.py | 1 - 1 file changed, 1 deletion(-) diff --git a/exts/qrz.py b/exts/qrz.py index 3ab6858..5846062 100644 --- a/exts/qrz.py +++ b/exts/qrz.py @@ -71,7 +71,6 @@ class QRZCog(commands.Cog): embed.set_thumbnail(url=resp_data['image']) data = qrz_process_info(resp_data) - print(data) for title, val in data.items(): if val is not None: