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 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)
cfg = getcfg(0)
@ -14,6 +14,7 @@ db_filename = script_path+"/"+"mL-ham_logbook.dat"
db = {}
db["users"] = {}
db["logs"] = {}
isAborted = False
## define FG colours
DBLK = "|00"
@ -346,16 +347,27 @@ def exportLogBook() :
def checkConfig(S = None) :
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.upper() == "RESET" :
if handle in db["users"] :
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"] :
db["users"][handle] = {}
isok = False
while not isok :
writeln("|CL|07You haven't yet configured your details, lets walk through them now.")
writeln(cStatus)
writeln("")
gotoxy(1,3)
write("What is your Amateur Radio call sign: ")
@ -392,11 +404,10 @@ def checkConfig(S = None) :
saveDB()
## start main program
loadDB()
checkConfig()
if not isAborted :
showTitle()
## main loop