respect punctuation level in settings file, levels and dicts are not configurable now
This commit is contained in:
parent
a3cb14e072
commit
4b5d12c91d
@ -93,7 +93,7 @@ doubleTapDelay=0.2
|
|||||||
|
|
||||||
[general]
|
[general]
|
||||||
debugLevel=0
|
debugLevel=0
|
||||||
punctuationLevel=1
|
punctuationLevel=Some
|
||||||
numberOfClipboards=10
|
numberOfClipboards=10
|
||||||
# define the current fenrir key
|
# define the current fenrir key
|
||||||
fenrirKeys=KEY_KP0,KEY_META
|
fenrirKeys=KEY_KP0,KEY_META
|
||||||
|
@ -44,7 +44,7 @@ doubleTapDelay=0.2
|
|||||||
|
|
||||||
[general]
|
[general]
|
||||||
debugLevel=0
|
debugLevel=0
|
||||||
punctuationLevel=1
|
punctuationLevel=Some
|
||||||
numberOfClipboards=10
|
numberOfClipboards=10
|
||||||
fenrirKeys=KEY_KP0
|
fenrirKeys=KEY_KP0
|
||||||
timeFormat=%H:%M:%P
|
timeFormat=%H:%M:%P
|
||||||
|
@ -14,11 +14,10 @@ class punctuationManager():
|
|||||||
self.env = environment
|
self.env = environment
|
||||||
self.allPunctNone = dict.fromkeys(map(ord, string.punctuation), None)
|
self.allPunctNone = dict.fromkeys(map(ord, string.punctuation), None)
|
||||||
self.punctuation = {
|
self.punctuation = {
|
||||||
'currLevel':'Some',
|
|
||||||
'levels':{
|
'levels':{
|
||||||
'None': '',
|
'NONE': '',
|
||||||
'Some': '.,:-$~+*-/\\@;',
|
'SOME': '.,:-$~+*-/\\@;',
|
||||||
'All': string.punctuation,
|
'ALL': string.punctuation,
|
||||||
},
|
},
|
||||||
'punctuationDict':{
|
'punctuationDict':{
|
||||||
'&':'and',
|
'&':'and',
|
||||||
@ -84,8 +83,8 @@ class punctuationManager():
|
|||||||
def proceedPunctuation(self, text, ignorePunctuation=False):
|
def proceedPunctuation(self, text, ignorePunctuation=False):
|
||||||
resultText = self.useCustomDict(text, self.punctuation['customDict'])
|
resultText = self.useCustomDict(text, self.punctuation['customDict'])
|
||||||
currPunctLevel = ''
|
currPunctLevel = ''
|
||||||
if not ignorePunctuation and self.punctuation['currLevel'] in self.punctuation['levels']:
|
if not ignorePunctuation and self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').upper() in self.punctuation['levels']:
|
||||||
currPunctLevel = self.punctuation['levels'][self.punctuation['currLevel']]
|
currPunctLevel = self.punctuation['levels'][self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').upper()]
|
||||||
else:
|
else:
|
||||||
currPunctLevel = string.punctuation
|
currPunctLevel = string.punctuation
|
||||||
resultText = self.usePunctuationDict(resultText, self.punctuation['punctuationDict'], currPunctLevel)
|
resultText = self.usePunctuationDict(resultText, self.punctuation['punctuationDict'], currPunctLevel)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user