From d2f8c064ab1abd915ee91e6aa554d1d9ad221c70 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Thu, 15 Sep 2016 16:56:47 +0200 Subject: [PATCH] Update commandManager.py --- src/fenrir-package/core/commandManager.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/fenrir-package/core/commandManager.py b/src/fenrir-package/core/commandManager.py index 8743e919..f2735074 100644 --- a/src/fenrir-package/core/commandManager.py +++ b/src/fenrir-package/core/commandManager.py @@ -64,17 +64,18 @@ class commandManager(): environment['commandInfo']['lastCommandExecutionTime'] = time.time() return environment - def isShortcutDefined(self, environment, currShortcutString): - return( currShortcutString in environment['bindings']) + def isShortcutDefined(self, environment, shortcut): + return( str(shortcut).upper() in environment['bindings']) def setCurrCommandForExec(self, environment, currCommand): environment['commandInfo']['currCommand'] = currCommand return environment - def getCommandForShortcut(self, environment, currShortcutString): - if not self.isShortcutDefined(environment, currShortcutString): + def getCommandForShortcut(self, environment, shortcut): + shortcut = shortcut.upper() + if not self.isShortcutDefined(environment, shortcut): return '' - return environment['bindings'][currShortcutString] + return environment['bindings'][shortcut] def isCommandDefined(self, environment, currCommand): return( currCommand in environment['commands']['commands'])