From d380ab711d50753ea5af069efea49069e7389250 Mon Sep 17 00:00:00 2001 From: Chrys Date: Sat, 24 Aug 2019 19:27:24 +0200 Subject: [PATCH] make ,..# vaid section#option separators --- .../core/settingsManager.py | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/fenrirscreenreader/core/settingsManager.py b/src/fenrirscreenreader/core/settingsManager.py index eb21d70a..a3e57848 100644 --- a/src/fenrirscreenreader/core/settingsManager.py +++ b/src/fenrirscreenreader/core/settingsManager.py @@ -240,18 +240,32 @@ class settingsManager(): #self.env['runtime']['debug'].writeDebugOut('settingsManager:setOptionArgDict:Datatype missmatch: '+ section + '#' + setting + '=' + value + ' Error:' + str(e), debug.debugLevel.ERROR) return - - def parseSettingArgs(self, settingArgs): for optionElem in settingArgs.split(';'): - if len(optionElem.split('#',1)) != 2: + settingValList = [] + sectionOptionList = [] + section = '' + option = '' + value = '' + settingValList = optionElem.split('=',1) + if len(settingValList) != 2: continue - if len(optionElem.split('#',1)[1].split('=',1)) != 2: + if '#' in settingValList[0]: + sectionOptionList = settingValList[0].split('#', 1) + elif '.' in settingValList[0]: + sectionOptionList = settingValList[0].split('.', 1) + elif ',' in settingValList[0]: + sectionOptionList = settingValList[0].split(',', 1) + elif '!' in settingValList[0]: + sectionOptionList = settingValList[0].split('!', 1) + else: + continue + if len(sectionOptionList) != 2: continue - section = str(optionElem.split('#',1)[0]) - option = str(optionElem.split('#',1)[1].split('=',1)[0]) - value = optionElem.split('#',1)[1].split('=',1)[1] + section = str(sectionOptionList[0]) + option = str(sectionOptionList[1]) + value = str(settingValList[1]) self.setOptionArgDict(section, option, value) def initFenrirConfig(self, cliArgs, fenrirManager = None, environment = environment.environment):