hotfix on the language system

This commit is contained in:
Adrien Bourmault 2019-08-12 17:29:22 +02:00 committed by GitHub
parent 2df174b234
commit 67b5c903d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 21 deletions

View File

@ -79,24 +79,33 @@ def main():
## BOOTSTRAP OF CNIREVELATOR ## BOOTSTRAP OF CNIREVELATOR
try:
# LANGUAGE
if os.path.isfile(globs.CNIRLangFile):
with open(globs.CNIRLangFile, 'r') as (configFile):
try:
# Reading it
globs.CNIRlang = configFile.read()
except Exception as e:
ihm.crashCNIR()
raise IOError(str(e))
else:
# Recreating the url file
try:
os.mkdir(globs.CNIRFolder + '\\config')
except:
pass
# LANGUAGE with open(globs.CNIRLangFile, 'w') as (configFile):
if os.path.isfile(globs.CNIRLangFile): try:
with open(globs.CNIRLangFile, 'r') as (configFile): # Writing it
try: configFile.write(globs.CNIRlang)
# Reading it except Exception as e:
globs.CNIRlang = configFile.read() ihm.crashCNIR()
except Exception as e: raise IOError(str(e))
ihm.crashCNIR() except:
raise IOError(str(e)) ihm.crashCNIR()
else: updater.exitProcess(1)
with open(globs.CNIRLangFile, 'w') as (configFile):
try:
# Writing it
configFile.write(globs.CNIRlang)
except Exception as e:
ihm.crashCNIR()
raise IOError(str(e))
# GO # GO
try: try:
@ -124,5 +133,6 @@ try:
main() main()
except Exception as e: except Exception as e:
ihm.crashCNIR() ihm.crashCNIR()
updater.exitProcess(1)
updater.exitProcess(0) updater.exitProcess(0)

View File

@ -50,4 +50,4 @@ CNIRUrlConfig = CNIRFolder + '\\config\\urlconf.ig'
CNIRVerStock = CNIRFolder + '\\downloads\\versions.lst' CNIRVerStock = CNIRFolder + '\\downloads\\versions.lst'
CNIREnv = CNIRFolder + '\\Data\\' CNIREnv = CNIRFolder + '\\Data\\'
CNIROpenFile = True CNIROpenFile = False

View File

@ -1,4 +1,4 @@
""" """
******************************************************************************** ********************************************************************************
* CNIRevelator * * CNIRevelator *
* * * *
@ -209,8 +209,6 @@ class LauncherWindow(Tk):
logfile = logger.logCur logfile = logger.logCur
logfile.printdbg('Launcher IHM successful') logfile.printdbg('Launcher IHM successful')
self.protocol('WM_DELETE_WINDOW', lambda : 0) self.protocol('WM_DELETE_WINDOW', lambda : 0)
self.attributes("-topmost", 1)
self.update() self.update()
def printmsg(self, msg): def printmsg(self, msg):