diff --git a/src/fenrir-package/core/inputManager.py b/src/fenrir-package/core/inputManager.py index bd64ec89..e044624f 100644 --- a/src/fenrir-package/core/inputManager.py +++ b/src/fenrir-package/core/inputManager.py @@ -10,14 +10,14 @@ class inputManager(): return environment def shutdown(self, environment): return environment - def getInput(self, environment): + def proceedInputEvent(self, environment): environment, timeout = environment['runtime']['inputDriver'].getInput(environment) return environment, timeout def grabDevices(self, environment): environment['runtime']['inputDriver'].grabDevices(environment) def releaseDevices(self, environment): - environment['runtime']['inputDriver'].releaseDevices(environment) + environment['runtime']['inputDriver'].releaseDevices() def isConsumeInput(self, environment): return environment['input']['consumeKey'] and \ diff --git a/src/fenrir-package/core/runtime.py b/src/fenrir-package/core/runtime.py index 39a3b755..06d87e9c 100644 --- a/src/fenrir-package/core/runtime.py +++ b/src/fenrir-package/core/runtime.py @@ -9,5 +9,6 @@ runtime = { 'inputManager': None, 'commandManager': None, 'screenManager': None, +'outputManager': None, 'debug':None, } diff --git a/src/fenrir-package/core/screenManager.py b/src/fenrir-package/core/screenManager.py index 906d2721..6fa48274 100644 --- a/src/fenrir-package/core/screenManager.py +++ b/src/fenrir-package/core/screenManager.py @@ -16,6 +16,6 @@ class screenManager(): return environment def isSuspendingScreen(self, environment): - return environment['generalInformation']['suspend'] = environment['runtime']['screenDriver'].getCurrScreen() in \ + return environment['runtime']['screenDriver'].getCurrScreen() in \ environment['runtime']['settingsManager'].getSetting(environment,'screen', 'suspendingScreen').split(',') diff --git a/src/fenrir-package/core/settingsManager.py b/src/fenrir-package/core/settingsManager.py index 1ecc90ef..769da93c 100644 --- a/src/fenrir-package/core/settingsManager.py +++ b/src/fenrir-package/core/settingsManager.py @@ -184,7 +184,7 @@ class settingsManager(): spec = importlib.util.spec_from_file_location(driverName, 'input/' + driverName + '.py') driver_mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(driver_mod) - environment['runtime']['inputDriver'] = driver_mod.screen() + environment['runtime']['inputDriver'] = driver_mod.input() environment['runtime']['inputDriver'].initialize(environment) return environment diff --git a/src/fenrir-package/fenrir.py b/src/fenrir-package/fenrir.py index bf5f96d7..4ed09d5f 100755 --- a/src/fenrir-package/fenrir.py +++ b/src/fenrir-package/fenrir.py @@ -28,7 +28,7 @@ class fenrir(): self.shutdown() def handleProcess(self): - self.environment, timeout = self.environment['runtime']['inputManager'].proceedInputEvents(self.environment) + self.environment, timeout = self.environment['runtime']['inputManager'].proceedInputEvent(self.environment) try: self.environment = self.environment['runtime']['screenManager'].update(self.environment) except Exception as e: @@ -58,10 +58,11 @@ class fenrir(): if self.environment['runtime']['debug'] != None: self.environment['runtime']['debug'].closeDebugFile() if self.environment['runtime']['soundDriver'] != None: - self.environment['runtime']['soundDriver'].shutdown() + self.environment['runtime']['soundDriver'].shutdown(environment) if self.environment['runtime']['speechDriver'] != None: - self.environment['runtime']['speechDriver'].shutdown() - self.environment['runtime']['inputManager'].freeDevices() + self.environment['runtime']['speechDriver'].shutdown(environment) + self.environment['runtime']['inputManager'].releaseDevices(self.environment) + self.environment = None app = fenrir() app.proceed() diff --git a/src/fenrir-package/screen/linux.py b/src/fenrir-package/screen/linux.py index ab0951a3..9ac31fe8 100644 --- a/src/fenrir-package/screen/linux.py +++ b/src/fenrir-package/screen/linux.py @@ -16,14 +16,15 @@ class screen(): def insert_newlines(self, string, every=64): return '\n'.join(string[i:i+every] for i in range(0, len(string), every)) def getCurrScreen(self): + currScreen = -1 try: currScreenFile = open('/sys/devices/virtual/tty/tty0/active','r') currScreen = currScreenFile.read()[3:-1] currScreenFile.close() except Exception as e: environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR) - return -1 - return currScreen + + return currScreen def update(self, environment, trigger='updateScreen'): newTTY = '' diff --git a/src/fenrir-package/sound/sox.py b/src/fenrir-package/sound/sox.py index d84f278f..d48ec776 100644 --- a/src/fenrir-package/sound/sox.py +++ b/src/fenrir-package/sound/sox.py @@ -18,5 +18,3 @@ class sound(): pass def setVolume(self, volume): self.volume = volume - def shutdown(self): - pass