fenrir/src/fenrir-package/core/screenManager.py

29 lines
1.2 KiB
Python
Raw Normal View History

#!/bin/python
import time
from utils import debug
class screenManager():
def __init__(self):
pass
def initialize(self, environment):
2016-09-13 07:04:55 -04:00
self.autoIgnoreScreens = []
if environment['runtime']['settingsManager'].getSettingAsBool(environment,'screen', 'autodetectSuspendingScreen'):
self.autoIgnoreScreens = environment['runtime']['screenDriver'].getIgnoreScreens()
return environment
def shutdown(self, environment):
return environment
2016-09-12 19:25:08 -04:00
def update(self, environment):
environment['generalInformation']['suspend'] = self.isSuspendingScreen(environment)
if not environment['generalInformation']['suspend']:
environment = environment['runtime']['screenDriver'].update(environment)
environment['screenData']['lastScreenUpdate'] = time.time()
return environment
def isSuspendingScreen(self, environment):
2016-09-13 07:04:55 -04:00
currScreen = environment['runtime']['screenDriver'].getCurrScreen()
return ((currScreen in \
2016-09-13 07:04:55 -04:00
environment['runtime']['settingsManager'].getSetting(environment,'screen', 'suspendingScreen').split(',')) or
(currScreen in self.autoIgnoreScreens))