summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Ward <none@none>2009-11-04 18:11:58 -0500
committerIan Ward <none@none>2009-11-04 18:11:58 -0500
commit58c51dc63941fd6649dcbccc941732c54cd91363 (patch)
treed501ae3a4438f73f79c558a91c904516df615493
parentca9b16d617c14a6e425f3306c31a129f5906c6d3 (diff)
downloadurwid-58c51dc63941fd6649dcbccc941732c54cd91363.tar.gz
untab command_map.py
-rw-r--r--urwid/command_map.py70
1 files changed, 35 insertions, 35 deletions
diff --git a/urwid/command_map.py b/urwid/command_map.py
index 569d86e..29e1a53 100644
--- a/urwid/command_map.py
+++ b/urwid/command_map.py
@@ -22,42 +22,42 @@
class CommandMap:
- _command_defaults = {
- 'tab': 'next selectable',
- 'ctrl n': 'next selectable',
- 'shift tab': 'prev selectable',
- 'ctrl p': 'prev selectable',
- 'ctrl l': 'redraw screen',
- 'esc': 'menu',
- 'up': 'cursor up',
- 'down': 'cursor down',
- 'left': 'cursor left',
- 'right': 'cursor right',
- 'page up': 'cursor page up',
- 'page down': 'cursor page down',
- 'home': 'cursor max left',
- 'end': 'cursor max right',
- ' ': 'activate',
- 'enter': 'activate',
- }
+ _command_defaults = {
+ 'tab': 'next selectable',
+ 'ctrl n': 'next selectable',
+ 'shift tab': 'prev selectable',
+ 'ctrl p': 'prev selectable',
+ 'ctrl l': 'redraw screen',
+ 'esc': 'menu',
+ 'up': 'cursor up',
+ 'down': 'cursor down',
+ 'left': 'cursor left',
+ 'right': 'cursor right',
+ 'page up': 'cursor page up',
+ 'page down': 'cursor page down',
+ 'home': 'cursor max left',
+ 'end': 'cursor max right',
+ ' ': 'activate',
+ 'enter': 'activate',
+ }
- def __init__(self):
- self.restore_defaults()
+ def __init__(self):
+ self.restore_defaults()
- def restore_defaults(self):
- self._command = dict(self._command_defaults)
-
- def __getitem__(self, key):
- return self._command.get(key, None)
-
- def __setitem__(self, key, command):
- self._command[key] = command
+ def restore_defaults(self):
+ self._command = dict(self._command_defaults)
+
+ def __getitem__(self, key):
+ return self._command.get(key, None)
+
+ def __setitem__(self, key, command):
+ self._command[key] = command
- def __delitem__(self, key):
- del self._command[key]
-
- def clear_command(self, command):
- dk = [k for k, v in self._command.items() if v == command]
- for k in dk:
- del self._command[key]
+ def __delitem__(self, key):
+ del self._command[key]
+
+ def clear_command(self, command):
+ dk = [k for k, v in self._command.items() if v == command]
+ for k in dk:
+ del self._command[key]
command_map = CommandMap() # shared command mappings