fix: 新增登入中的暫轉
This commit is contained in:
parent
f3d4f06d01
commit
deb93f4f45
@ -7,12 +7,27 @@ from Moodle import *
|
|||||||
from NcnuMainWin import *
|
from NcnuMainWin import *
|
||||||
from api.moodle import MoodleAPI
|
from api.moodle import MoodleAPI
|
||||||
from api.ncnu import NcnuAPI
|
from api.ncnu import NcnuAPI
|
||||||
|
import threading
|
||||||
|
|
||||||
|
moodle = None
|
||||||
|
ncnu = None
|
||||||
|
|
||||||
win=Tk()
|
win=Tk()
|
||||||
firstWin(win)
|
firstWin(win)
|
||||||
def checkJson():
|
def checkJson():
|
||||||
|
def login():
|
||||||
|
global moodle, ncnu
|
||||||
moodle = MoodleAPI(CONFIG['moodle']['username'], CONFIG['moodle']['password'])
|
moodle = MoodleAPI(CONFIG['moodle']['username'], CONFIG['moodle']['password'])
|
||||||
ncnu = NcnuAPI(CONFIG['NCNU']['username'], CONFIG['NCNU']['password'])
|
ncnu = NcnuAPI(CONFIG['NCNU']['username'], CONFIG['NCNU']['password'])
|
||||||
|
tempWin.destroy()
|
||||||
|
|
||||||
|
tempWin = Tk()
|
||||||
|
Label(tempWin, text="登入中...", font="50").pack()
|
||||||
|
t = threading.Thread(target=login)
|
||||||
|
t.start()
|
||||||
|
|
||||||
|
tempWin.mainloop()
|
||||||
|
|
||||||
if moodle.status and ncnu.status:
|
if moodle.status and ncnu.status:
|
||||||
mainWin=Tk()
|
mainWin=Tk()
|
||||||
createMainWin(mainWin,ncnu,moodle)
|
createMainWin(mainWin,ncnu,moodle)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user