Use dict.get instead of catching exceptions.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
parent
dc4f8e4909
commit
f6c5e4bbb7
1 changed files with 2 additions and 5 deletions
|
|
@ -182,11 +182,8 @@ class RecordEditBox(urwid.Edit, Tabbable):
|
|||
return bool(self.get_edit_text())
|
||||
|
||||
def keypress(self, size, key):
|
||||
try:
|
||||
if len(key) > 1 and key != "enter":
|
||||
key = DatabaseData().keys[key]
|
||||
except:
|
||||
pass
|
||||
if len(key) > 1 and key != "enter":
|
||||
key = DatabaseData().keys.get(key, key)
|
||||
if key in ("next-field", "previous-field"):
|
||||
return self._handle_tab(key)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue