diff --git a/src/fenrir-package/core/screenManager.py b/src/fenrir-package/core/screenManager.py index d96dd937..ea76667f 100644 --- a/src/fenrir-package/core/screenManager.py +++ b/src/fenrir-package/core/screenManager.py @@ -18,7 +18,7 @@ class screenManager(): def update(self, environment): if not self.isSuspendingScreen(environment): - environment = environment['runtime']['screenDriver'].update(environment) + environment['runtime']['screenDriver'].update(environment) environment['screenData']['lastScreenUpdate'] = time.time() def isSuspendingScreen(self, environment): diff --git a/src/fenrir-package/screenDriver/linux.py b/src/fenrir-package/screenDriver/linux.py index 98bff678..1aa72995 100644 --- a/src/fenrir-package/screenDriver/linux.py +++ b/src/fenrir-package/screenDriver/linux.py @@ -10,10 +10,10 @@ class driver(): self.vcsaDevicePath = '/dev/vcsa' def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def insert_newlines(self, string, every=64): return '\n'.join(string[i:i+every] for i in range(0, len(string), every)) @@ -26,7 +26,6 @@ class driver(): currScreenFile.close() except Exception as e: environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR) - return currScreen def getIgnoreScreens(self): @@ -114,5 +113,3 @@ class driver(): environment['screenData']['newDelta'] = ''.join(x[2:] for x in diffList if x.startswith('+ ')) environment['screenData']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x.startswith('- ')) - return environment - diff --git a/src/fenrir-package/sound.py b/src/fenrir-package/sound.py old mode 100644 new mode 100755 diff --git a/src/fenrir-package/soundDriver/generic.py b/src/fenrir-package/soundDriver/generic.py index 3ced8e68..3728b65e 100644 --- a/src/fenrir-package/soundDriver/generic.py +++ b/src/fenrir-package/soundDriver/generic.py @@ -15,10 +15,10 @@ class driver(): self.soundFileCommand = 'play -q -v fenrirVolume fenrirSoundFile' if self.frequenceCommand == '': self.frequenceCommand = '=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence' - return environment + return def shutdown(self, environment): self.cancel() - return environment + return def playFrequence(self, frequence, duration, adjustVolume): if interrupt: self.cancel() diff --git a/src/fenrir-package/soundDriver/gstreamer.py b/src/fenrir-package/soundDriver/gstreamer.py index 09e41867..228b6de9 100644 --- a/src/fenrir-package/soundDriver/gstreamer.py +++ b/src/fenrir-package/soundDriver/gstreamer.py @@ -20,9 +20,9 @@ class driver: return def initialize(self, environment): if self._initialized: - return environment + return if not _gstreamerAvailable: - return environment + return self._player = Gst.ElementFactory.make('playbin', 'player') bus = self._player.get_bus() @@ -41,9 +41,14 @@ class driver: self._source.link(self._sink) self._initialized = True - return environment + return def shutdown(self, environment): - return environment + global _gstreamerAvailable + if not _gstreamerAvailable: + return + self.cancel() + self._initialized = False + _gstreamerAvailable = False def _onPlayerMessage(self, bus, message): if message.type == Gst.MessageType.EOS: @@ -92,12 +97,6 @@ class driver: self._pipeline.set_state(Gst.State.NULL) def setVolume(self, volume): self.volume = volume - def shutdown(self): - global _gstreamerAvailable - if not _gstreamerAvailable: - return - self.cancel() - self._initialized = False - _gstreamerAvailable = False + diff --git a/src/fenrir-package/speechDriver/espeak.py b/src/fenrir-package/speechDriver/espeak.py index 70064a61..941b1160 100644 --- a/src/fenrir-package/speechDriver/espeak.py +++ b/src/fenrir-package/speechDriver/espeak.py @@ -13,9 +13,9 @@ class driver(): except: self._initialized = False def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def speak(self,text, queueable=True): if not self._isInitialized: diff --git a/src/fenrir-package/speechDriver/generic.py b/src/fenrir-package/speechDriver/generic.py index b67a3264..ff6a7134 100644 --- a/src/fenrir-package/speechDriver/generic.py +++ b/src/fenrir-package/speechDriver/generic.py @@ -6,10 +6,9 @@ class driver(): def __init__(self ): pass def initialize(self, environment): - self._isInitialized = False - return environment + self._isInitialized = False def shutdown(self, environment): - return environment + pass def speak(self,text, queueable=True): if not self._isInitialized: