add get out if you don't have a licence

This commit is contained in:
MeaTLoTioN 2021-11-30 16:45:01 +00:00
parent 8eb97d7add
commit 64656bf332

View File

@ -1,6 +1,6 @@
from mystic_bbs import * from mystic_bbs import *
from datetime import datetime from datetime import datetime
import os, pickle, json, calendar, time, operator, subprocess, requests import os, pickle, json, calendar, time, operator, subprocess, requests, sys
user = getuser(0) user = getuser(0)
cfg = getcfg(0) cfg = getcfg(0)
@ -14,6 +14,7 @@ db_filename = script_path+"/"+"mL-ham_logbook.dat"
db = {} db = {}
db["users"] = {} db["users"] = {}
db["logs"] = {} db["logs"] = {}
isAborted = False
## define FG colours ## define FG colours
DBLK = "|00" DBLK = "|00"
@ -346,16 +347,27 @@ def exportLogBook() :
def checkConfig(S = None) : def checkConfig(S = None) :
global db global db
global isAborted
if handle not in db["users"] :
writeln("|CLDo you have an Amateur Radio Licence and Call-sign? (Y/N)")
ch = onekey(chr(13) + 'YN', False)
if ch == 'N' :
isAborted = True
if S : if S :
if S.upper() == "RESET" : if S.upper() == "RESET" :
if handle in db["users"] : if handle in db["users"] :
del db["users"][handle] del db["users"][handle]
cStatus = "|CL|07Reconfiguring your details now."
else:
cStatus = "|CL|07You haven't yet configured your details, lets walk through them now."
if not isAborted :
if handle not in db["users"] : if handle not in db["users"] :
db["users"][handle] = {} db["users"][handle] = {}
isok = False isok = False
while not isok : while not isok :
writeln("|CL|07You haven't yet configured your details, lets walk through them now.") writeln(cStatus)
writeln("") writeln("")
gotoxy(1,3) gotoxy(1,3)
write("What is your Amateur Radio call sign: ") write("What is your Amateur Radio call sign: ")
@ -392,14 +404,13 @@ def checkConfig(S = None) :
saveDB() saveDB()
## start main program ## start main program
loadDB() loadDB()
checkConfig() checkConfig()
showTitle() if not isAborted :
showTitle()
## main loop ## main loop
while canexit == "no": while canexit == "no":
canexit = mainMenu() canexit = mainMenu()