From 449f149f97418414379ba25b12940f4ad35e3392 Mon Sep 17 00:00:00 2001 From: chrys Date: Mon, 26 Jun 2017 01:41:19 +0200 Subject: [PATCH] fix -o for camel case options --- src/fenrir/core/fenrirManager.py | 4 ++-- src/fenrir/core/settingsManager.py | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/fenrir/core/fenrirManager.py b/src/fenrir/core/fenrirManager.py index 1681ced2..b6a1bddd 100644 --- a/src/fenrir/core/fenrirManager.py +++ b/src/fenrir/core/fenrirManager.py @@ -63,8 +63,8 @@ class fenrirManager(): self.environment['runtime']['inputManager'].clearEventBuffer() if self.environment['input']['keyForeward'] > 0: self.environment['input']['keyForeward'] -=1 - self.environment['runtime']['screenManager'].update('onInput') - self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput') + #self.environment['runtime']['screenManager'].update('onInput') + #self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput') self.handleCommands() def handleScreenChange(self): self.environment['runtime']['screenManager'].update('onScreenChange') diff --git a/src/fenrir/core/settingsManager.py b/src/fenrir/core/settingsManager.py index aad79688..069a8564 100644 --- a/src/fenrir/core/settingsManager.py +++ b/src/fenrir/core/settingsManager.py @@ -147,7 +147,7 @@ class settingsManager(): def getSetting(self, section, setting): value = '' try: - value = self.settingArgDict[section][setting] + value = self.settingArgDict[section.lower()][setting.lower()] return value except: pass @@ -160,10 +160,10 @@ class settingsManager(): def getSettingAsInt(self, section, setting): value = 0 try: - value = int(self.settingArgDict[section][setting]) + value = int(self.settingArgDict[section.lower()][setting.lower()]) return value - except: - pass + except Exception as e: + pass try: value = self.env['settings'].getint(section, setting) except: @@ -173,7 +173,7 @@ class settingsManager(): def getSettingAsFloat(self, section, setting): value = 0.0 try: - value = float(self.settingArgDict[section][setting]) + value = float(self.settingArgDict[section.lower()][setting.lower()]) return value except Exception as e: pass @@ -186,7 +186,7 @@ class settingsManager(): def getSettingAsBool(self, section, setting): value = False try: - value = self.settingArgDict[section][setting].upper() in ['1','YES','JA','TRUE'] + value = self.settingArgDict[section.lower()][setting.lower()].upper() in ['1','YES','JA','TRUE'] return value except Exception as e: pass @@ -241,6 +241,7 @@ class settingsManager(): except KeyError: optionArgDict[section] = {} optionArgDict[section][option] = str(value) + print(optionArgDict) return optionArgDict def initFenrirConfig(self, cliArgs, fenrirManager = None, environment = environment.environment): settingsRoot = '/etc/fenrir/'