diff --git a/config/settings/settings.conf b/config/settings/settings.conf index 0ee2d0eb..677dd232 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -93,7 +93,7 @@ doubleTapDelay=0.2 [general] debugLevel=0 -punctuationLevel=1 +punctuationLevel=Some numberOfClipboards=10 # define the current fenrir key fenrirKeys=KEY_KP0,KEY_META diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index 4f8268f0..702bf13b 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -44,7 +44,7 @@ doubleTapDelay=0.2 [general] debugLevel=0 -punctuationLevel=1 +punctuationLevel=Some numberOfClipboards=10 fenrirKeys=KEY_KP0 timeFormat=%H:%M:%P diff --git a/src/fenrir-package/core/punctuationManager.py b/src/fenrir-package/core/punctuationManager.py index e33bf6d0..c10fbeb5 100644 --- a/src/fenrir-package/core/punctuationManager.py +++ b/src/fenrir-package/core/punctuationManager.py @@ -14,11 +14,10 @@ class punctuationManager(): self.env = environment self.allPunctNone = dict.fromkeys(map(ord, string.punctuation), None) self.punctuation = { - 'currLevel':'Some', 'levels':{ - 'None': '', - 'Some': '.,:-$~+*-/\\@;', - 'All': string.punctuation, + 'NONE': '', + 'SOME': '.,:-$~+*-/\\@;', + 'ALL': string.punctuation, }, 'punctuationDict':{ '&':'and', @@ -84,8 +83,8 @@ class punctuationManager(): def proceedPunctuation(self, text, ignorePunctuation=False): resultText = self.useCustomDict(text, self.punctuation['customDict']) currPunctLevel = '' - if not ignorePunctuation and self.punctuation['currLevel'] in self.punctuation['levels']: - currPunctLevel = self.punctuation['levels'][self.punctuation['currLevel']] + if not ignorePunctuation and self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').upper() in self.punctuation['levels']: + currPunctLevel = self.punctuation['levels'][self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').upper()] else: currPunctLevel = string.punctuation resultText = self.usePunctuationDict(resultText, self.punctuation['punctuationDict'], currPunctLevel)