1
0
mirror of https://gitlab.os-k.eu/neox/CNIRevelator.git synced 2023-08-25 14:03:10 +02:00

Update CNIRLauncher.py

This commit is contained in:
Adrien Bourmault 2019-07-08 16:25:33 +02:00 committed by GitHub
parent 6793974411
commit dafe98a347
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,33 +32,38 @@ import traceback
import updater # updater.py
import ihm # ihm.py
import globs # globs.py
from globs import logfile
import logger # logger.py
## Main function
## Global Handlers
logfile = logger.logCur
launcherWindow = ihm.launcherWindowCur
## Main function
def main():
# Starting the main update thread
mainThread.start()
# Hello world
logfile.printdbg('*** CNIRLauncher LOGFILE. Hello World ! ***')
logfile.printdbg('Files in directory : ' + str(os.listdir(globs.CNIRFolder)))
#logfile.printdbg('Files in directory : ' + str(os.listdir(globs.CNIRFolder)))
# Hello user
launcherWindow = ihm.LauncherWindow()
launcherWindow.progressBar.configure(mode='indeterminate', value=0, maximum=20)
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text='Chalut!')
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text='Starting...')
launcherWindow.progressBar.start()
launcherWindow.mainloop()
## Bootstrap
logfile.printdbg('*** CNIRLauncher LOGFILE. Goodbye World ! ***')
return
## Bootstrap
try:
mainThread = threading.Thread(target=updater.umain, daemon=True)
main()
except Exception:
mainThread = threading.Thread(target=updater.umain, daemon=False)
main()
except Exception:
logfile.printerr("A FATAL ERROR OCCURED : " + str(traceback.format_exc()))
sys.exit(1)
sys.exit(0)
sys.exit(0)