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

Update updater.py

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

View File

@ -22,10 +22,15 @@
* along with CNIRevelator. If not, see <https:*www.gnu.org/licenses/>. *
********************************************************************************
"""
from globs import logfile
from win32com.client import Dispatch
from win32com.client import Dispatch
import traceback
import sys
import time
import logger # logger.py
import globs # globs.py
import ihm # ihm.py
def createShortcut(path, target='', wDir='', icon=''):
ext = path[-3:]
@ -45,6 +50,42 @@ def createShortcut(path, target='', wDir='', icon=''):
shortcut.IconLocation = icon
shortcut.save()
## Main Batch Function
def batch():
# Global Handlers
logfile = logger.logCur
launcherWindow = ihm.launcherWindowCur
for i in range(0,10000):
if i % 1000 : launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text=('Starting... ' + str(i)))
return
## Main Function
def umain():
for i in range(0,155555555555555):
print(i)
try:
# Global Handlers
logfile = logger.logCur
launcherWindow = ihm.launcherWindowCur
try:
batch()
except Exception as e:
logfile.printerr("An error occured on the thread : " + str(traceback.format_exc()))
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text=('ERROR : ' + str(e)))
time.sleep(3)
launcherWindow.destroy()
return 1
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text='Software is up-to-date !')
time.sleep(2)
launcherWindow.destroy()
return 0
except:
logfile.printerr("A FATAL ERROR OCCURED : " + str(traceback.format_exc()))
launcherWindow.destroy()
sys.exit(2)
return 2