From 1b45024d4b3d7c2f88a7380c52c323ae9c831293 Mon Sep 17 00:00:00 2001 From: Michael Clemens Date: Fri, 21 May 2021 17:56:55 +0200 Subject: [PATCH] last QSO table will not be shown anymore if there are no previous QSOs --- qrzlogger.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/qrzlogger.py b/qrzlogger.py index a817ea0..8e18d9d 100644 --- a/qrzlogger.py +++ b/qrzlogger.py @@ -151,7 +151,6 @@ def getQSOsForCallsign(callsign): v = re.sub('^.*:',"",i, flags=re.DOTALL) k = re.sub(':.*$',"",i, flags=re.DOTALL) result[-1][k] = v - return result @@ -335,13 +334,13 @@ if __name__ == '__main__': print(tab) print(style.RESET) - print ('%s%sPrevious QSOs with %s%s' % (style.UNDERLINED, hlcol, call, style.RESET)) - result = getQSOsForCallsign(call) - tab = getQSOTable(result) - print(tablecol) - print(tab) - print(style.RESET) + if result[0]: + print ('%s%sPrevious QSOs with %s%s' % (style.UNDERLINED, hlcol, call, style.RESET)) + tab = getQSOTable(result) + print(tablecol) + print(tab) + print(style.RESET) print ('%s%sEnter new QSO details below%s\n' % (style.UNDERLINED, hlcol, style.RESET)) @@ -383,5 +382,5 @@ if __name__ == '__main__': keeponlogging = False print(inputcol) - print("Bye, bye!") + print("73!") print(style.RESET)