get all the functions working
This commit is contained in:
parent
161e6d398f
commit
c463d2bcae
@ -90,7 +90,7 @@ def mainMenu():
|
|||||||
'2': 'Add a logbook entry',
|
'2': 'Add a logbook entry',
|
||||||
'3': 'Delete a logbook entry',
|
'3': 'Delete a logbook entry',
|
||||||
'C': 'Change your user config',
|
'C': 'Change your user config',
|
||||||
'X': 'Export/Download your entire log (CSV)',
|
'D': 'Download your entire log (CSV)',
|
||||||
'Q': 'Quit back to the BBS'
|
'Q': 'Quit back to the BBS'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ def mainMenu():
|
|||||||
#writeln(str(cfg))
|
#writeln(str(cfg))
|
||||||
write(ind + "|15Choose: ")
|
write(ind + "|15Choose: ")
|
||||||
|
|
||||||
ch = onekey(chr(13) + '123CXQ', False)
|
ch = onekey(chr(13) + '123CDQ', False)
|
||||||
write("|CR")
|
write("|CR")
|
||||||
|
|
||||||
if ch == 'Q':
|
if ch == 'Q':
|
||||||
@ -120,10 +120,8 @@ def mainMenu():
|
|||||||
delLogBook()
|
delLogBook()
|
||||||
if ch == 'C':
|
if ch == 'C':
|
||||||
checkConfig("RESET")
|
checkConfig("RESET")
|
||||||
if ch == 'X':
|
if ch == 'D':
|
||||||
exportLogBook()
|
exportLogBook()
|
||||||
if ch == 'Y':
|
|
||||||
exportScoreboard()
|
|
||||||
|
|
||||||
return finished
|
return finished
|
||||||
|
|
||||||
@ -204,12 +202,12 @@ def delLogBook() :
|
|||||||
global db
|
global db
|
||||||
global handle
|
global handle
|
||||||
found = False
|
found = False
|
||||||
|
writeln("|CL")
|
||||||
for LOG in sorted(db["logs"], reverse=True) :
|
for LOG in sorted(db["logs"], reverse=True) :
|
||||||
if db["logs"][LOG]["reportedBy"] == handle :
|
if db["logs"][LOG]["reportedBy"] == handle :
|
||||||
found = True
|
found = True
|
||||||
writeln(LOG+" ")
|
writeln(LOG)
|
||||||
if found :
|
if found :
|
||||||
writeln("|CL")
|
|
||||||
write("|CREnter the date of the entry to delete: ")
|
write("|CREnter the date of the entry to delete: ")
|
||||||
getDate = getstr(1,16,16,"")
|
getDate = getstr(1,16,16,"")
|
||||||
if getDate :
|
if getDate :
|
||||||
@ -271,7 +269,7 @@ def exportLogBook() :
|
|||||||
|
|
||||||
callsign = db["users"][handle]["callsign"]
|
callsign = db["users"][handle]["callsign"]
|
||||||
tempFile = script_path+"/"+"mL-ham_logbook_"+callsign.lower()+".csv"
|
tempFile = script_path+"/"+"mL-ham_logbook_"+callsign.lower()+".csv"
|
||||||
fHandle = open(tempFile, "a")
|
fHandle = open(tempFile, "w")
|
||||||
fHandle.write("Date,Callsign,Name,Sig IN,Sig OUT,Notes\n")
|
fHandle.write("Date,Callsign,Name,Sig IN,Sig OUT,Notes\n")
|
||||||
found = False
|
found = False
|
||||||
|
|
||||||
@ -289,6 +287,9 @@ def exportLogBook() :
|
|||||||
os.remove(tempFile)
|
os.remove(tempFile)
|
||||||
writeln("File exported")
|
writeln("File exported")
|
||||||
writeln("|PA")
|
writeln("|PA")
|
||||||
|
if not found :
|
||||||
|
writeln("Sorry, no records to export. Aborted.")
|
||||||
|
writeln("|PA")
|
||||||
|
|
||||||
|
|
||||||
def checkConfig(S = None) :
|
def checkConfig(S = None) :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user