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:
parent
8cbec148da
commit
ba084abdeb
@ -22,10 +22,15 @@
|
|||||||
* along with CNIRevelator. If not, see <https:*www.gnu.org/licenses/>. *
|
* 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 globs # globs.py
|
||||||
|
import ihm # ihm.py
|
||||||
|
|
||||||
def createShortcut(path, target='', wDir='', icon=''):
|
def createShortcut(path, target='', wDir='', icon=''):
|
||||||
ext = path[-3:]
|
ext = path[-3:]
|
||||||
@ -45,6 +50,42 @@ def createShortcut(path, target='', wDir='', icon=''):
|
|||||||
shortcut.IconLocation = icon
|
shortcut.IconLocation = icon
|
||||||
shortcut.save()
|
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():
|
def umain():
|
||||||
for i in range(0,155555555555555):
|
try:
|
||||||
print(i)
|
# 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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user