last QSO table will not be shown anymore if there are no previous QSOs

This commit is contained in:
Michael Clemens 2021-05-21 17:56:55 +02:00
parent 0cc4406664
commit 1b45024d4b
1 changed files with 7 additions and 8 deletions

View File

@ -151,7 +151,6 @@ def getQSOsForCallsign(callsign):
v = re.sub('^.*:',"",i, flags=re.DOTALL) v = re.sub('^.*:',"",i, flags=re.DOTALL)
k = re.sub(':.*$',"",i, flags=re.DOTALL) k = re.sub(':.*$',"",i, flags=re.DOTALL)
result[-1][k] = v result[-1][k] = v
return result return result
@ -335,9 +334,9 @@ if __name__ == '__main__':
print(tab) print(tab)
print(style.RESET) print(style.RESET)
print ('%s%sPrevious QSOs with %s%s' % (style.UNDERLINED, hlcol, call, style.RESET))
result = getQSOsForCallsign(call) result = getQSOsForCallsign(call)
if result[0]:
print ('%s%sPrevious QSOs with %s%s' % (style.UNDERLINED, hlcol, call, style.RESET))
tab = getQSOTable(result) tab = getQSOTable(result)
print(tablecol) print(tablecol)
print(tab) print(tab)
@ -383,5 +382,5 @@ if __name__ == '__main__':
keeponlogging = False keeponlogging = False
print(inputcol) print(inputcol)
print("Bye, bye!") print("73!")
print(style.RESET) print(style.RESET)