add ignoreFile for screens

This commit is contained in:
chrys 2018-03-13 22:45:52 +01:00
parent 2493761bc7
commit 9978f6dcee
7 changed files with 15 additions and 1 deletions

View File

@ -122,6 +122,7 @@ driver=vcsaDriver
encoding=auto encoding=auto
screenUpdateDelay=0.05 screenUpdateDelay=0.05
suspendingScreen= suspendingScreen=
suspendingScreenFile=/tmp/fenrirSuspend
autodetectSuspendingScreen=True autodetectSuspendingScreen=True
[keyboard] [keyboard]

View File

@ -124,6 +124,7 @@ driver=vcsaDriver
encoding=auto encoding=auto
screenUpdateDelay=0.05 screenUpdateDelay=0.05
suspendingScreen= suspendingScreen=
suspendingScreenFile=/tmp/fenrirSuspend
autodetectSuspendingScreen=True autodetectSuspendingScreen=True
[keyboard] [keyboard]

View File

@ -125,6 +125,7 @@ driver=vcsaDriver
encoding=auto encoding=auto
screenUpdateDelay=0.05 screenUpdateDelay=0.05
suspendingScreen= suspendingScreen=
suspendingScreenFile=/tmp/fenrirSuspend
autodetectSuspendingScreen=True autodetectSuspendingScreen=True
[keyboard] [keyboard]

View File

@ -79,6 +79,7 @@ driver=vcsaDriver
encoding=auto encoding=auto
screenUpdateDelay=0.05 screenUpdateDelay=0.05
suspendingScreen= suspendingScreen=
suspendingScreenFile=/tmp/fenrirSuspend
autodetectSuspendingScreen=True autodetectSuspendingScreen=True
[keyboard] [keyboard]

View File

@ -124,6 +124,7 @@ driver=vcsaDriver
encoding=auto encoding=auto
screenUpdateDelay=0.05 screenUpdateDelay=0.05
suspendingScreen= suspendingScreen=
suspendingScreenFile=/tmp/fenrirSuspend
autodetectSuspendingScreen=True autodetectSuspendingScreen=True
[keyboard] [keyboard]

View File

@ -5,7 +5,7 @@
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from core import debug from core import debug
import time import time, os
class screenManager(): class screenManager():
def __init__(self): def __init__(self):
@ -60,6 +60,14 @@ class screenManager():
if self.env['runtime']['settingsManager'].getSettingAsBool('screen', 'autodetectSuspendingScreen'): if self.env['runtime']['settingsManager'].getSettingAsBool('screen', 'autodetectSuspendingScreen'):
ignoreScreens.extend(self.env['screen']['autoIgnoreScreens']) ignoreScreens.extend(self.env['screen']['autoIgnoreScreens'])
self.env['runtime']['debug'].writeDebugOut('screenManager:isSuspendingScreen ' + str(ignoreScreens) + ' '+ str(self.env['screen']['newTTY']),debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut('screenManager:isSuspendingScreen ' + str(ignoreScreens) + ' '+ str(self.env['screen']['newTTY']),debug.debugLevel.INFO)
try:
ignoreFileName = self.env['runtime']['settingsManager'].getSetting('screen', 'suspendingScreenFile')
if ignoreFileName != '':
if os.access(ignoreFileName, os.R_OK):
with open(ignoreFileName) as fp:
ignoreScreens.extend(fp.read().replace('\n','').split(','))
except:
pass
return (screen in ignoreScreens) return (screen in ignoreScreens)
def isScreenChange(self): def isScreenChange(self):

View File

@ -51,6 +51,7 @@ settingsData = {
'encoding': 'auto', 'encoding': 'auto',
'screenUpdateDelay': 0.1, 'screenUpdateDelay': 0.1,
'suspendingScreen': '', 'suspendingScreen': '',
'suspendingScreenFile': '/tmp/fenrirSuspend',
'autodetectSuspendingScreen': False, 'autodetectSuspendingScreen': False,
}, },
'general':{ 'general':{