finalize: custom command zone; auto screen detection
This commit is contained in:
parent
d15ec7991e
commit
4cee4b5504
@ -138,7 +138,7 @@ dateFormat=%A, %B %d, %Y
|
|||||||
autoSpellCheck=True
|
autoSpellCheck=True
|
||||||
spellCheckLanguage=en_US
|
spellCheckLanguage=en_US
|
||||||
scriptPath=/usr/share/fenrir/scripts
|
scriptPath=/usr/share/fenrir/scripts
|
||||||
commandPath=/usr/share/fenrir/command
|
commandPath=/usr/share/fenrir/commands
|
||||||
|
|
||||||
[focus]
|
[focus]
|
||||||
cursor=True
|
cursor=True
|
||||||
|
@ -141,7 +141,7 @@ spellCheckLanguage=en_US
|
|||||||
# path for your scripts "scriptKey" functionality
|
# path for your scripts "scriptKey" functionality
|
||||||
scriptPath=/usr/share/fenrir/scripts
|
scriptPath=/usr/share/fenrir/scripts
|
||||||
# overload commands, and create new one without changing Fenrir default
|
# overload commands, and create new one without changing Fenrir default
|
||||||
commandPath=/usr/share/fenrir/command
|
commandPath=/usr/share/fenrir/commands
|
||||||
|
|
||||||
[focus]
|
[focus]
|
||||||
#follow the text cursor
|
#follow the text cursor
|
||||||
|
@ -139,7 +139,7 @@ autoSpellCheck=True
|
|||||||
spellCheckLanguage=en_US
|
spellCheckLanguage=en_US
|
||||||
scriptPath=/usr/share/fenrir/scripts
|
scriptPath=/usr/share/fenrir/scripts
|
||||||
# overload commands, and create new one without changing Fenrir default
|
# overload commands, and create new one without changing Fenrir default
|
||||||
commandPath=/usr/share/fenrir/command
|
commandPath=/usr/share/fenrir/commands
|
||||||
|
|
||||||
[focus]
|
[focus]
|
||||||
#follow the text cursor
|
#follow the text cursor
|
||||||
|
@ -90,7 +90,7 @@ autoSpellCheck=True
|
|||||||
spellCheckLanguage=en_US
|
spellCheckLanguage=en_US
|
||||||
scriptPath=/usr/share/fenrir/scripts
|
scriptPath=/usr/share/fenrir/scripts
|
||||||
# overload commands, and create new one without changing Fenrir default
|
# overload commands, and create new one without changing Fenrir default
|
||||||
commandPath=/usr/share/fenrir/command
|
commandPath=/usr/share/fenrir/commands
|
||||||
|
|
||||||
[focus]
|
[focus]
|
||||||
#follow the text cursor
|
#follow the text cursor
|
||||||
|
@ -50,12 +50,12 @@ class commandManager():
|
|||||||
|
|
||||||
def loadCommands(self, section='commands',commandPath=''):
|
def loadCommands(self, section='commands',commandPath=''):
|
||||||
if commandPath =='':
|
if commandPath =='':
|
||||||
commandPath = os.path.dirname(os.path.realpath(__main__.__file__))
|
commandPath = os.path.dirname(os.path.realpath(__main__.__file__))+ "/commands/"
|
||||||
if not commandPath.endswith('/'):
|
if not commandPath.endswith('/'):
|
||||||
commandPath += '/'
|
commandPath += '/'
|
||||||
commandFolder = commandPath + "commands/" + section +"/"
|
commandFolder = commandPath + section +"/"
|
||||||
if not os.path.exists(commandFolder):
|
if not os.path.exists(commandFolder):
|
||||||
self.env['runtime']['debug'].writeDebugOut("commandFolder not exists:" + commandFolder ,debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut("commandFolder not exists:" + commandFolder ,debug.debugLevel.WARNING)
|
||||||
return
|
return
|
||||||
if not os.path.isdir(commandFolder):
|
if not os.path.isdir(commandFolder):
|
||||||
self.env['runtime']['debug'].writeDebugOut("commandFolder not a directory:" + commandFolder ,debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut("commandFolder not a directory:" + commandFolder ,debug.debugLevel.ERROR)
|
||||||
@ -63,6 +63,7 @@ class commandManager():
|
|||||||
if not os.access(commandFolder, os.R_OK):
|
if not os.access(commandFolder, os.R_OK):
|
||||||
self.env['runtime']['debug'].writeDebugOut("commandFolder not readable:" + commandFolder ,debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut("commandFolder not readable:" + commandFolder ,debug.debugLevel.ERROR)
|
||||||
return
|
return
|
||||||
|
print(commandFolder)
|
||||||
commandList = glob.glob(commandFolder+'*')
|
commandList = glob.glob(commandFolder+'*')
|
||||||
for command in commandList:
|
for command in commandList:
|
||||||
try:
|
try:
|
||||||
@ -70,8 +71,11 @@ class commandManager():
|
|||||||
fileName = fileName.split('/')[-1]
|
fileName = fileName.split('/')[-1]
|
||||||
if fileName.startswith('__'):
|
if fileName.startswith('__'):
|
||||||
continue
|
continue
|
||||||
if self.env['commands'][section][fileName.upper()]:
|
try:
|
||||||
continue
|
if self.env['commands'][section][fileName.upper()] != None:
|
||||||
|
continue
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if fileExtension.lower() == '.py':
|
if fileExtension.lower() == '.py':
|
||||||
command_mod = module_utils.importModule(fileName, command)
|
command_mod = module_utils.importModule(fileName, command)
|
||||||
self.env['commands'][section][fileName.upper()] = command_mod.command()
|
self.env['commands'][section][fileName.upper()] = command_mod.command()
|
||||||
@ -79,7 +83,7 @@ class commandManager():
|
|||||||
self.env['commands'][section][fileName.upper()].initialize(self.env)
|
self.env['commands'][section][fileName.upper()].initialize(self.env)
|
||||||
self.env['runtime']['debug'].writeDebugOut("Load command:" + section + "." + fileName.upper() ,debug.debugLevel.INFO, onAnyLevel=True)
|
self.env['runtime']['debug'].writeDebugOut("Load command:" + section + "." + fileName.upper() ,debug.debugLevel.INFO, onAnyLevel=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(command+str(e))
|
||||||
self.env['runtime']['debug'].writeDebugOut("Loading command:" + command ,debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut("Loading command:" + command ,debug.debugLevel.ERROR)
|
||||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||||
continue
|
continue
|
||||||
|
@ -41,7 +41,7 @@ class screenManager():
|
|||||||
if fixIgnoreScreens != '':
|
if fixIgnoreScreens != '':
|
||||||
ignoreScreens.append(fixIgnoreScreens.split(','))
|
ignoreScreens.append(fixIgnoreScreens.split(','))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('screen', 'autodetectSuspendingScreen'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('screen', 'autodetectSuspendingScreen'):
|
||||||
ignoreScreens.append(self.env['screenData']['autoIgnoreScreens'])
|
ignoreScreens.extend(self.env['screenData']['autoIgnoreScreens'])
|
||||||
return (screen in ignoreScreens)
|
return (screen in ignoreScreens)
|
||||||
|
|
||||||
def isScreenChange(self):
|
def isScreenChange(self):
|
||||||
|
@ -60,7 +60,7 @@ settings = {
|
|||||||
'autoSpellCheck': False,
|
'autoSpellCheck': False,
|
||||||
'spellCheckLanguage': 'en_US',
|
'spellCheckLanguage': 'en_US',
|
||||||
'scriptPath':'/usr/share/fenrir/scripts',
|
'scriptPath':'/usr/share/fenrir/scripts',
|
||||||
'commandPath':'/usr/share/fenrir/command',
|
'commandPath':'/usr/share/fenrir/commands',
|
||||||
},
|
},
|
||||||
'focus':{
|
'focus':{
|
||||||
'cursor': True,
|
'cursor': True,
|
||||||
|
Loading…
Reference in New Issue
Block a user