From 3465b96bc660d4bcd09345414a5486a5901ee341 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 26 Jul 2016 15:12:42 +0200 Subject: [PATCH] Update settingsManager.py --- src/fenrir-package/core/settingsManager.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fenrir-package/core/settingsManager.py b/src/fenrir-package/core/settingsManager.py index dbc24071..a9138184 100644 --- a/src/fenrir-package/core/settingsManager.py +++ b/src/fenrir-package/core/settingsManager.py @@ -13,7 +13,7 @@ class settingsManager(): def __init__(self): self.settings = settings - def loadShortcuts(self, environment, kbConfigPath='../../config/keyboard/desktop.kb'): + def loadShortcuts(self, environment, kbConfigPath='../../config/keyboard/desktop.conf'): kbConfig = open(kbConfigPath,"r") while(True): line = kbConfig.readline() @@ -67,7 +67,7 @@ class settingsManager(): except: return 0 - def loadSettings(self, environment, settingConfigPath='../../config/settings/settings.cfg'): + def loadSettings(self, environment, settingConfigPath='../../config/settings/settings.conf'): environment['settings'] = ConfigParser() environment['settings'].read(settingConfigPath) return environment @@ -139,8 +139,13 @@ class settingsManager(): environment['runtime']['settingsManager'] = self environment['runtime']['inputManager'] = inputManager.inputManager() environment['runtime']['outputManager'] = outputManager.outputManager() - environment = environment['runtime']['settingsManager'].loadShortcuts(environment) environment = environment['runtime']['settingsManager'].loadSettings(environment) + if not os.path.exists(self.getSetting('keyboard','keyboardLayout')): + if os.path.exists('/etc/fenrir/'+ self.getSetting('keyboard','keyboardLayout')): + self.setSetting(environment, 'keyboard', 'keyboardLayout', '/etc/fenrir/'+ self.getSetting('keyboard','keyboardLayout')): + if os.path.exists('/etc/fenrir/'+ self.getSetting('keyboard','keyboardLayout') + '.conf'): + self.setSetting(environment, 'keyboard', 'keyboardLayout', '/etc/fenrir/'+ self.getSetting('keyboard','keyboardLayout') + '.conf'): + environment = environment['runtime']['settingsManager'].loadShortcuts(environment, self.getSetting('keyboard','keyboardLayout')) environment['runtime']['commandManager'] = commandManager.commandManager() environment = environment['runtime']['commandManager'].loadCommands(environment,'commands')