From 3ac70c14e5302c70502e6d827fa5049a8a5f52d2 Mon Sep 17 00:00:00 2001 From: chrys Date: Mon, 12 Sep 2016 22:17:10 +0200 Subject: [PATCH] first fixes --- .../commands/commands/review_bottom.py | 12 ++++++++---- src/fenrir-package/core/commandManager.py | 10 ++++------ src/fenrir-package/fenrir.py | 11 +++++++---- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/fenrir-package/commands/commands/review_bottom.py b/src/fenrir-package/commands/commands/review_bottom.py index f03a70ef..65c55914 100644 --- a/src/fenrir-package/commands/commands/review_bottom.py +++ b/src/fenrir-package/commands/commands/review_bottom.py @@ -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 + environment['runtime']['outputManager'].presentText(environment, "Bottom", interrupt=True) + return environment def setCallback(self, callback): pass - def shutdown(self): - pass diff --git a/src/fenrir-package/core/commandManager.py b/src/fenrir-package/core/commandManager.py index 0331240c..1e692243 100644 --- a/src/fenrir-package/core/commandManager.py +++ b/src/fenrir-package/core/commandManager.py @@ -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): diff --git a/src/fenrir-package/fenrir.py b/src/fenrir-package/fenrir.py index aa54987f..1e23bd1d 100755 --- a/src/fenrir-package/fenrir.py +++ b/src/fenrir-package/fenrir.py @@ -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')