mirror of
https://gitlab.os-k.eu/neox/CNIRevelator.git
synced 2023-08-25 14:03:10 +02:00
Minor updating system enhancements
This commit is contained in:
parent
84a74f804d
commit
a6762755a0
@ -40,7 +40,7 @@ launcherWindow = ihm.launcherWindowCur
|
||||
|
||||
## MAIN FUNCTION OF CNIREVELATOR
|
||||
def main():
|
||||
|
||||
|
||||
import CNI_pytesseract as pytesseract
|
||||
try:
|
||||
os.environ['PATH'] = CST_FOLDER + 'Tesseract-OCR4\\'
|
||||
@ -52,7 +52,7 @@ def main():
|
||||
text = 'Tesseract version ' + str(tesser_version) + ' Licensed Apache 2004 successfully initiated\n'
|
||||
main_w.montext(text)
|
||||
main_w.montext('\n\nEntrez la première ligne de MRZ svp \n')
|
||||
|
||||
|
||||
if CST_CHANGELOG.isOn:
|
||||
showinfo('Changelog : résumé de mise à jour', ('Version du logiciel : ' + CST_VER + ' ' + CST_TYPE + ' Revision ' + CST_REV + '\n\n' + CST_CHANGELOG.text), parent=main_w)
|
||||
logger.info('main() : **** Launching App_main() ****')
|
||||
|
@ -131,7 +131,8 @@ def batch():
|
||||
|
||||
getTheUpdate = downloader.newdownload(credentials, finalurl, globs.CNIRFolder + '\\..\\CNIPackage.zip').download()
|
||||
|
||||
# BUF_SIZE is totally arbitrary, change for your app!
|
||||
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text=('Verifying download...'))
|
||||
|
||||
BUF_SIZE = 65536 # lets read stuff in 64kb chunks!
|
||||
|
||||
sha1 = hashlib.sha1()
|
||||
@ -151,17 +152,35 @@ def batch():
|
||||
return False
|
||||
|
||||
# And now unzip and launch
|
||||
logfile.printdbg("Make place")
|
||||
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text=('Preparing installation...'))
|
||||
try:
|
||||
shutil.rmtree(globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full) + 'temp')
|
||||
shutil.rmtree(globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full))
|
||||
except:
|
||||
pass
|
||||
|
||||
logfile.printdbg("Unzipping the package")
|
||||
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text=('Installing the updates'))
|
||||
zip_ref = zipfile.ZipFile(globs.CNIRFolder + '\\..\\CNIPackage.zip', 'r')
|
||||
zip_ref.extractall(globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full))
|
||||
zip_ref.extractall(globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full) + 'temp')
|
||||
zip_ref.close()
|
||||
|
||||
logfile.printdbg(globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full) + '\\CNIRevelator.exe')
|
||||
shutil.copytree(globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full) + 'temp\\CNIRevelator', globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full))
|
||||
shutil.rmtree(globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full) + 'temp')
|
||||
|
||||
logfile.printdbg('Extracted :' + globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full) + '\\CNIRevelator.exe')
|
||||
|
||||
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text=('Success !'))
|
||||
|
||||
args = [globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full) + '\\CNIRevelator.exe', globs.CNIRFolder]
|
||||
subprocess.run(args)
|
||||
|
||||
return True
|
||||
|
||||
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text=('Launched the new process.'))
|
||||
|
||||
launcherWindow.destroy()
|
||||
sys.exit(0)
|
||||
return
|
||||
|
||||
## Main Function
|
||||
def umain():
|
||||
|
Loading…
Reference in New Issue
Block a user