fix sorted listings and show list of entries for deletion
This commit is contained in:
parent
96f52c1ff8
commit
41bc71c75c
@ -154,10 +154,13 @@ def delLogBook() :
|
|||||||
global db
|
global db
|
||||||
global handle
|
global handle
|
||||||
writeln("|CL")
|
writeln("|CL")
|
||||||
write("Enter the date of the entry to delete: ")
|
for LOG in sorted(db["logs"], reverse=True) :
|
||||||
|
if db["logs"][LOG]["reportedBy"] == handle :
|
||||||
|
writeln(LOG+" ")
|
||||||
|
write("|CREnter the date of the entry to delete: ")
|
||||||
getDate = getstr(10,15,15,"")
|
getDate = getstr(10,15,15,"")
|
||||||
if getDate :
|
if getDate :
|
||||||
if db["logs"][getDate] :
|
if getDate in db["logs"] :
|
||||||
del db["logs"][getDate]
|
del db["logs"][getDate]
|
||||||
saveDB()
|
saveDB()
|
||||||
writeln("Deleted: "+getDate)
|
writeln("Deleted: "+getDate)
|
||||||
@ -174,9 +177,9 @@ def viewLogBook() :
|
|||||||
found = False
|
found = False
|
||||||
|
|
||||||
writeln("|CL|CR")
|
writeln("|CL|CR")
|
||||||
writeln("Date".ljust(16)+"Callsign".ljust(10)+"Name".ljust(22)+"Sig IN".ljust(8)+"Sig OUT".ljust(8)+"Notes".ljust(15))
|
writeln(" "+"Date".ljust(15)+"Callsign".ljust(10)+"Name".ljust(22)+"Sig IN".ljust(8)+"Sig OUT".ljust(8)+"Notes".ljust(15))
|
||||||
writeln("="*79)
|
writeln(" "+"="*78)
|
||||||
for LOG in db["logs"] :
|
for LOG in sorted(db["logs"], reverse=True) :
|
||||||
if db["logs"][LOG]["reportedBy"] == handle :
|
if db["logs"][LOG]["reportedBy"] == handle :
|
||||||
found = True
|
found = True
|
||||||
contactCall = str(db["logs"][LOG]["contactCall"])
|
contactCall = str(db["logs"][LOG]["contactCall"])
|
||||||
@ -190,7 +193,7 @@ def viewLogBook() :
|
|||||||
else :
|
else :
|
||||||
notesAvailable = "N/A"
|
notesAvailable = "N/A"
|
||||||
|
|
||||||
writeln(LOG.ljust(16)+contactCall.ljust(10)+theirName.ljust(22)+observedSig.ljust(8)+yourSig.ljust(8)+notesAvailable.ljust(15))
|
writeln(" "+LOG.ljust(15)+contactCall.ljust(10)+theirName.ljust(22)+observedSig.center(8)+yourSig.center(8)+notesAvailable.ljust(15))
|
||||||
writeln("")
|
writeln("")
|
||||||
#writeln(str(db["logs"]))
|
#writeln(str(db["logs"]))
|
||||||
if not found :
|
if not found :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user