remove some more unneeded return values
This commit is contained in:
parent
0729d2daf2
commit
5ad6cbbb68
@ -18,7 +18,7 @@ class screenManager():
|
|||||||
|
|
||||||
def update(self, environment):
|
def update(self, environment):
|
||||||
if not self.isSuspendingScreen(environment):
|
if not self.isSuspendingScreen(environment):
|
||||||
environment = environment['runtime']['screenDriver'].update(environment)
|
environment['runtime']['screenDriver'].update(environment)
|
||||||
environment['screenData']['lastScreenUpdate'] = time.time()
|
environment['screenData']['lastScreenUpdate'] = time.time()
|
||||||
|
|
||||||
def isSuspendingScreen(self, environment):
|
def isSuspendingScreen(self, environment):
|
||||||
|
@ -10,10 +10,10 @@ class driver():
|
|||||||
self.vcsaDevicePath = '/dev/vcsa'
|
self.vcsaDevicePath = '/dev/vcsa'
|
||||||
|
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
return environment
|
pass
|
||||||
|
|
||||||
def shutdown(self, environment):
|
def shutdown(self, environment):
|
||||||
return environment
|
pass
|
||||||
|
|
||||||
def insert_newlines(self, string, every=64):
|
def insert_newlines(self, string, every=64):
|
||||||
return '\n'.join(string[i:i+every] for i in range(0, len(string), every))
|
return '\n'.join(string[i:i+every] for i in range(0, len(string), every))
|
||||||
@ -26,7 +26,6 @@ class driver():
|
|||||||
currScreenFile.close()
|
currScreenFile.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
||||||
|
|
||||||
return currScreen
|
return currScreen
|
||||||
|
|
||||||
def getIgnoreScreens(self):
|
def getIgnoreScreens(self):
|
||||||
@ -114,5 +113,3 @@ class driver():
|
|||||||
environment['screenData']['newDelta'] = ''.join(x[2:] for x in diffList if x.startswith('+ '))
|
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('- '))
|
environment['screenData']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x.startswith('- '))
|
||||||
|
|
||||||
return environment
|
|
||||||
|
|
||||||
|
0
src/fenrir-package/sound.py
Normal file → Executable file
0
src/fenrir-package/sound.py
Normal file → Executable file
@ -15,10 +15,10 @@ class driver():
|
|||||||
self.soundFileCommand = 'play -q -v fenrirVolume fenrirSoundFile'
|
self.soundFileCommand = 'play -q -v fenrirVolume fenrirSoundFile'
|
||||||
if self.frequenceCommand == '':
|
if self.frequenceCommand == '':
|
||||||
self.frequenceCommand = '=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence'
|
self.frequenceCommand = '=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence'
|
||||||
return environment
|
return
|
||||||
def shutdown(self, environment):
|
def shutdown(self, environment):
|
||||||
self.cancel()
|
self.cancel()
|
||||||
return environment
|
return
|
||||||
def playFrequence(self, frequence, duration, adjustVolume):
|
def playFrequence(self, frequence, duration, adjustVolume):
|
||||||
if interrupt:
|
if interrupt:
|
||||||
self.cancel()
|
self.cancel()
|
||||||
|
@ -20,9 +20,9 @@ class driver:
|
|||||||
return
|
return
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
if self._initialized:
|
if self._initialized:
|
||||||
return environment
|
return
|
||||||
if not _gstreamerAvailable:
|
if not _gstreamerAvailable:
|
||||||
return environment
|
return
|
||||||
|
|
||||||
self._player = Gst.ElementFactory.make('playbin', 'player')
|
self._player = Gst.ElementFactory.make('playbin', 'player')
|
||||||
bus = self._player.get_bus()
|
bus = self._player.get_bus()
|
||||||
@ -41,9 +41,14 @@ class driver:
|
|||||||
self._source.link(self._sink)
|
self._source.link(self._sink)
|
||||||
|
|
||||||
self._initialized = True
|
self._initialized = True
|
||||||
return environment
|
return
|
||||||
def shutdown(self, environment):
|
def shutdown(self, environment):
|
||||||
return environment
|
global _gstreamerAvailable
|
||||||
|
if not _gstreamerAvailable:
|
||||||
|
return
|
||||||
|
self.cancel()
|
||||||
|
self._initialized = False
|
||||||
|
_gstreamerAvailable = False
|
||||||
|
|
||||||
def _onPlayerMessage(self, bus, message):
|
def _onPlayerMessage(self, bus, message):
|
||||||
if message.type == Gst.MessageType.EOS:
|
if message.type == Gst.MessageType.EOS:
|
||||||
@ -92,12 +97,6 @@ class driver:
|
|||||||
self._pipeline.set_state(Gst.State.NULL)
|
self._pipeline.set_state(Gst.State.NULL)
|
||||||
def setVolume(self, volume):
|
def setVolume(self, volume):
|
||||||
self.volume = volume
|
self.volume = volume
|
||||||
def shutdown(self):
|
|
||||||
global _gstreamerAvailable
|
|
||||||
if not _gstreamerAvailable:
|
|
||||||
return
|
|
||||||
self.cancel()
|
|
||||||
self._initialized = False
|
|
||||||
_gstreamerAvailable = False
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@ class driver():
|
|||||||
except:
|
except:
|
||||||
self._initialized = False
|
self._initialized = False
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
return environment
|
pass
|
||||||
def shutdown(self, environment):
|
def shutdown(self, environment):
|
||||||
return environment
|
pass
|
||||||
|
|
||||||
def speak(self,text, queueable=True):
|
def speak(self,text, queueable=True):
|
||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
|
@ -6,10 +6,9 @@ class driver():
|
|||||||
def __init__(self ):
|
def __init__(self ):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self._isInitialized = False
|
self._isInitialized = False
|
||||||
return environment
|
|
||||||
def shutdown(self, environment):
|
def shutdown(self, environment):
|
||||||
return environment
|
pass
|
||||||
|
|
||||||
def speak(self,text, queueable=True):
|
def speak(self,text, queueable=True):
|
||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
|
Loading…
Reference in New Issue
Block a user