shotdown everything more clean

This commit is contained in:
chrys 2016-09-15 00:21:22 +02:00
parent 72069e725b
commit 82757b7a93

View File

@ -58,11 +58,18 @@ class fenrir():
self.shutdownRequest() self.shutdownRequest()
def shutdown(self): def shutdown(self):
self.environment['runtime']['inputManager'].releaseDevices(self.environment)
self.environment['runtime']['outputManager'].presentText(self.environment, "Quit Fenrir", soundIcon='ScreenReaderOff', interrupt=True) self.environment['runtime']['outputManager'].presentText(self.environment, "Quit Fenrir", soundIcon='ScreenReaderOff', interrupt=True)
if self.environment['runtime']['screenManager']:
self.environment['runtime']['screenManager'].shutdown(self.environment)
if self.environment['runtime']['commandManager']:
self.environment['runtime']['commandManager'].shutdown(self.environment)
if self.environment['runtime']['inputManager']:
self.environment['runtime']['inputManager'].shutdown(self.environment)
if self.environment['runtime']['outputManager']:
self.environment['runtime']['outputManager'].shutdown(self.environment)
if self.environment['runtime']['screenDriver']: if self.environment['runtime']['screenDriver']:
self.environment['runtime']['screenDriver'].shutdown(self.environment) self.environment['runtime']['screenDriver'].shutdown(self.environment)
self.environment['runtime']['inputManager'].releaseDevices(self.environment)
if self.environment['runtime']['inputDriver']: if self.environment['runtime']['inputDriver']:
self.environment['runtime']['inputDriver'].shutdown(self.environment) self.environment['runtime']['inputDriver'].shutdown(self.environment)
if self.environment['runtime']['soundDriver']: if self.environment['runtime']['soundDriver']:
@ -71,6 +78,7 @@ class fenrir():
self.environment['runtime']['speechDriver'].shutdown(self.environment) self.environment['runtime']['speechDriver'].shutdown(self.environment)
if self.environment['runtime']['debug']: if self.environment['runtime']['debug']:
self.environment['runtime']['debug'].closeDebugFile() self.environment['runtime']['debug'].closeDebugFile()
time.sleep(0.8) # wait a little before splatter it :)
self.environment = None self.environment = None
app = fenrir() app = fenrir()