Skip to content

Commit

Permalink
fix: sms not defined error while closing
Browse files Browse the repository at this point in the history
  • Loading branch information
itsHenry35 committed Jun 17, 2023
1 parent 39c823d commit e6e9041
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions gui/login1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from ttkbootstrap.constants import *
import importlib
import tkinter.messagebox as mb
import sys

def login1():
global sms
Expand All @@ -18,6 +19,16 @@ def switchtosms():
sms = 'True'
username_ = username.get().replace('\r','').replace('\n','').replace('\t','')
root.destroy()
if sms == 'False':
return {'success' : 'True',
'usrname':username_,
'pwd':password_,
}
if sms == 'True':
return {
'success' : 'False',
'phonenum' : username_
}
def nextpage():
global username_
global password_
Expand Down Expand Up @@ -49,16 +60,10 @@ def nextpage():
submit.grid(row=3, column=2)
root.mainloop()
importlib.reload(ttk.style)
if sms == 'False':
return {'success' : 'True',
'usrname':username_,
'pwd':password_,
}
if sms == 'True':
return {
'success' : 'False',
'phonenum' : username_
}
try:
sms
except NameError:
sys.exit()

if __name__ == '__main__':
print(login1())

0 comments on commit e6e9041

Please sign in to comment.