first fixes

This commit is contained in:
chrys 2016-09-12 22:17:10 +02:00
parent 1ee4cbb159
commit 3ac70c14e5
3 changed files with 19 additions and 14 deletions

View File

@ -3,11 +3,15 @@
class command():
def __init__(self):
pass
def initialize(self, environment):
return environment
def shutdown(self, environment):
return environment
def getDescription(self):
return 'No Description found'
def run(self, environment):
environment['screenData']['newCursorReview'] = { 'x': 0, 'y':environment['screenData']['lines']}
environment['runtime']['outputManager'].presentText(environment, "Bottom", interrupt=True)
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass

View File

@ -64,18 +64,16 @@ class commandManager():
environment['commandInfo']['lastCommandTime'] = time.time()
return environment
def isShortcutDefined(self, environment, currCommand):
return( environment['input']['currShortcutString'] in environment['bindings'])
def isShortcutDefined(self, environment, currShortcutString):
return( currShortcutString in environment['bindings'])
def setCurrCommandForExec(self, environment, currCommand):
if not self.isShortcutDefined(environment):
return environment
environment['commandInfo']['currCommand'] = currCommand
return environment
def getCommandForShortcut(self, environment, currShortcutString):
if not self.isShortcutDefined(environment):
return environment
if not self.isShortcutDefined(environment, currShortcutString):
return ''
return environment['bindings'][currShortcutString]
def isCommandDefined(self, environment, currCommand):

View File

@ -29,14 +29,17 @@ class fenrir():
self.shutdown()
def handleProcess(self):
self.environment, timeout = self.environment['runtime']['inputManager'].proceedInputEvent(self.environment)
#self.environment, timeout = self.environment['runtime']['inputManager'].proceedInputEvent(self.environment)
timeout = True
try:
self.environment = self.environment['runtime']['screenManager'].update(self.environment)
except Exception as e:
print(e)
self.environment['runtime']['debug'].writeDebugOut(self.environment, str(e),debug.debugLevel.ERROR)
if not self.environment['input']['keyForeward']:
currShortcut = self.environment['runtime']['inputManager'].getCurrShortcut(self.environment)
currCommand = self.environment['runtime']['commandManager'].getCommandForShortcut(self.environment)
if not (self.environment['input']['keyForeward'] or timeout):
#currShortcut = self.environment['runtime']['inputManager'].getCurrShortcut(self.environment)
currShortcut = ''
currCommand = self.environment['runtime']['commandManager'].getCommandForShortcut(self.environment, currShortcut)
self.environment = self.environment['runtime']['commandManager'].setCurrCommandForExec(self.environment, currCommand)
if not timeout:
self.environment = self.environment['runtime']['commandManager'].executeTriggerCommands(self.environment, 'onInput')