Update fenrirManager.py

This commit is contained in:
chrys87 2017-07-19 11:12:18 +02:00 committed by GitHub
parent 6e132ae1fb
commit 0d6df688dc

View File

@ -17,7 +17,6 @@ import argparse
class fenrirManager(): class fenrirManager():
def __init__(self): def __init__(self):
self.initialized = False
cliArgs = self.handleArgs() cliArgs = self.handleArgs()
if not cliArgs: if not cliArgs:
return return
@ -27,7 +26,6 @@ class fenrirManager():
raise RuntimeError('Cannot Initialize. Maybe the configfile is not available or not parseable') raise RuntimeError('Cannot Initialize. Maybe the configfile is not available or not parseable')
except RuntimeError: except RuntimeError:
raise raise
self.initialized = True
self.environment['runtime']['outputManager'].presentText(_("Start Fenrir"), soundIcon='ScreenReaderOn', interrupt=True) self.environment['runtime']['outputManager'].presentText(_("Start Fenrir"), soundIcon='ScreenReaderOn', interrupt=True)
signal.signal(signal.SIGINT, self.captureSignal) signal.signal(signal.SIGINT, self.captureSignal)
signal.signal(signal.SIGTERM, self.captureSignal) signal.signal(signal.SIGTERM, self.captureSignal)
@ -50,8 +48,8 @@ class fenrirManager():
self.environment['runtime']['eventManager'].startMainEventLoop() self.environment['runtime']['eventManager'].startMainEventLoop()
self.shutdown() self.shutdown()
def handleInput(self): def handleInput(self):
startTime = time.time()
eventReceived = self.environment['runtime']['inputManager'].getInputEvent() eventReceived = self.environment['runtime']['inputManager'].getInputEvent()
startTime = time.time()
if eventReceived: if eventReceived:
self.prepareCommand() self.prepareCommand()
#if not self.environment['runtime']['screenManager'].isSuspendingScreen(): #if not self.environment['runtime']['screenManager'].isSuspendingScreen():
@ -71,6 +69,8 @@ class fenrirManager():
self.environment['runtime']['screenManager'].update('onInput') self.environment['runtime']['screenManager'].update('onInput')
self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput') self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput')
self.handleCommands() self.handleCommands()
print('handleInput:',time.time() - startTime)
def handleScreenChange(self): def handleScreenChange(self):
self.environment['runtime']['screenManager'].update('onScreenChange') self.environment['runtime']['screenManager'].update('onScreenChange')
''' '''
@ -83,7 +83,7 @@ class fenrirManager():
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenChanged') self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenChanged')
def handleScreenUpdate(self): def handleScreenUpdate(self):
s = time.time() startTime = time.time()
self.environment['runtime']['screenManager'].update('onUpdate') self.environment['runtime']['screenManager'].update('onUpdate')
''' '''
@ -98,7 +98,7 @@ class fenrirManager():
self.environment['runtime']['cursorManager'].isCursorHorizontalMove(): self.environment['runtime']['cursorManager'].isCursorHorizontalMove():
self.environment['runtime']['commandManager'].executeDefaultTrigger('onCursorChange') self.environment['runtime']['commandManager'].executeDefaultTrigger('onCursorChange')
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate') self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate')
#print(time.time() -s) print('handleScreenUpdate:',time.time() - startTime)
def handlePlugInputDevice(self): def handlePlugInputDevice(self):
self.environment['runtime']['commandManager'].executeDefaultTrigger('PlugInputDevice') self.environment['runtime']['commandManager'].executeDefaultTrigger('PlugInputDevice')