From 67b5c903d2ee0994fa2cabf66c28e4f6e400be59 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Mon, 12 Aug 2019 17:29:22 +0200 Subject: [PATCH] hotfix on the language system --- src/CNIRevelator.py | 44 +++++++++++++++++++++++++++----------------- src/globs.py | 2 +- src/ihm.py | 4 +--- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/CNIRevelator.py b/src/CNIRevelator.py index d332afe..8ab8c85 100644 --- a/src/CNIRevelator.py +++ b/src/CNIRevelator.py @@ -79,24 +79,33 @@ def main(): ## 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 -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: - with open(globs.CNIRLangFile, 'w') as (configFile): - try: - # Writing it - configFile.write(globs.CNIRlang) - except Exception as e: - ihm.crashCNIR() - raise IOError(str(e)) + with open(globs.CNIRLangFile, 'w') as (configFile): + try: + # Writing it + configFile.write(globs.CNIRlang) + except Exception as e: + ihm.crashCNIR() + raise IOError(str(e)) +except: + ihm.crashCNIR() + updater.exitProcess(1) # GO try: @@ -124,5 +133,6 @@ try: main() except Exception as e: ihm.crashCNIR() + updater.exitProcess(1) updater.exitProcess(0) \ No newline at end of file diff --git a/src/globs.py b/src/globs.py index e183884..c2a554a 100644 --- a/src/globs.py +++ b/src/globs.py @@ -50,4 +50,4 @@ CNIRUrlConfig = CNIRFolder + '\\config\\urlconf.ig' CNIRVerStock = CNIRFolder + '\\downloads\\versions.lst' CNIREnv = CNIRFolder + '\\Data\\' -CNIROpenFile = True \ No newline at end of file +CNIROpenFile = False \ No newline at end of file diff --git a/src/ihm.py b/src/ihm.py index 6759960..1c7d153 100644 --- a/src/ihm.py +++ b/src/ihm.py @@ -1,4 +1,4 @@ -""" +""" ******************************************************************************** * CNIRevelator * * * @@ -209,8 +209,6 @@ class LauncherWindow(Tk): logfile = logger.logCur logfile.printdbg('Launcher IHM successful') self.protocol('WM_DELETE_WINDOW', lambda : 0) - self.attributes("-topmost", 1) - self.update() def printmsg(self, msg):