catch when the user tries to view the application before they've made one

This commit is contained in:
MeaTLoTioN 2022-03-21 00:05:12 +00:00
parent 142f401eca
commit 76f9c62a52

View File

@ -112,9 +112,12 @@ def loadFile() :
global application
applicationDir = NETSPATH+"/"+ARG+"/applications"
applicationFile = applicationDir+"/"+handle+".dat"
if os.path.exists(applicationFile) :
file = open(applicationFile, 'rb')
application = pickle.load(file)
file.close()
else :
writeln("|CLSorry you need to create an application first|CL|PA")
def sendEmail() :
applicationDir = NETSPATH+"/"+ARG+"/applications"
@ -212,6 +215,7 @@ def addEditApplication() :
pktPassword = ""
ticPassword = ""
numNodes = ""
cramMD5 = ""
bbsSoftware = ""
# left side
@ -281,6 +285,9 @@ def addEditApplication() :
# view existing application
def viewApplication() :
initMainScreen()
applicationDir = NETSPATH+"/"+ARG+"/applications"
applicationFile = applicationDir+"/"+handle+".dat"
if os.path.exists(applicationFile) :
loadFile()
apDict = application[handle]
realName = apDict["realName"]
@ -322,6 +329,9 @@ def viewApplication() :
gotoxy(59,18); write("|"+fieldBG+" "*20+"|"+normBG); gotoxy(45,18); write("|"+normBG+"|"+normColour+"BBS Software: "+"|"+fieldBG+"|"+fieldFG+bbsSoftware+"|"+normBG)
gotoxy(1,23); write("|PA")
else :
writeln("|CRYou don't yet have a saved application.|CR|PA")
# pull network config first ready for main program to start
getNetCfg(ARG)
initMainScreen()