mirror of
https://gitlab.os-k.eu/neox/CNIRevelator.git
synced 2023-08-25 14:03:10 +02:00
Update system hotfix
This commit is contained in:
parent
767519b2a7
commit
99aa337a4c
@ -207,18 +207,24 @@ def tessInstall(PATH, credentials):
|
||||
logfile.printdbg('Preparing download of Tesseract OCR 4...')
|
||||
getTesseract = downloader.newdownload(credentials, tesseracturl, PATH + '\\downloads\\TsrtPackage.zip', "Tesseract 4 OCR Module").download()
|
||||
|
||||
try:
|
||||
# Unzip Tesseract
|
||||
logfile.printdbg("Unzipping the package")
|
||||
launcherWindow.printmsg('Installing the updates')
|
||||
zip_ref = zipfile.ZipFile(PATH + '\\downloads\\TsrtPackage.zip', 'r')
|
||||
zip_ref.extractall(PATH)
|
||||
zip_ref.close()
|
||||
|
||||
# Cleanup
|
||||
try:
|
||||
os.remove(UPATH + '\\downloads\\TsrtPackage.zip')
|
||||
except:
|
||||
pass
|
||||
return True
|
||||
|
||||
except:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
## Main Batch Function
|
||||
def batch(credentials):
|
||||
@ -374,7 +380,36 @@ def umain():
|
||||
try:
|
||||
# EXECUTING THE UPDATE BATCH
|
||||
success = batch(credentials)
|
||||
tessInstall(globs.CNIRFolder, credentials)
|
||||
except Exception as e:
|
||||
logfile.printerr("An error occured on the thread : " + str(traceback.format_exc()))
|
||||
launcherWindow.printmsg('ERROR : ' + str(e))
|
||||
time.sleep(3)
|
||||
launcherWindow.exit()
|
||||
return 1
|
||||
|
||||
if success:
|
||||
logfile.printdbg("Software is up-to-date !")
|
||||
launcherWindow.printmsg('Software is up-to-date !')
|
||||
else:
|
||||
logfile.printerr("An error occured. No effective update !")
|
||||
launcherWindow.printmsg('An error occured. No effective update !')
|
||||
time.sleep(2)
|
||||
launcherWindow.exit()
|
||||
return 0
|
||||
|
||||
if UPDATE_IS_MADE:
|
||||
launcherWindow.exit()
|
||||
return 0
|
||||
except:
|
||||
logfile.printerr("A FATAL ERROR OCCURED : " + str(traceback.format_exc()))
|
||||
launcherWindow.exit()
|
||||
sys.exit(2)
|
||||
return 2
|
||||
|
||||
try:
|
||||
try:
|
||||
# INSTALLING TESSERACT OCR
|
||||
success = tessInstall(globs.CNIRFolder, credentials)
|
||||
except Exception as e:
|
||||
logfile.printerr("An error occured on the thread : " + str(traceback.format_exc()))
|
||||
launcherWindow.printmsg('ERROR : ' + str(e))
|
||||
@ -398,5 +433,6 @@ def umain():
|
||||
sys.exit(2)
|
||||
return 2
|
||||
|
||||
return
|
||||
|
||||
time.sleep(2)
|
||||
launcherWindow.exit()
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user