diff options
author | hut <hut@lavabit.com> | 2010-04-16 17:00:32 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-04-16 17:00:32 +0200 |
commit | fbe99d189cdb7e0951e6afb7d55212eb096982a1 (patch) | |
tree | b4a39c86e4a74db282008a77a01ce903a9dcf76c /ranger | |
parent | 175290dbbba5e7bc5d416bc0ba87b687238976c4 (diff) | |
download | ranger-fbe99d189cdb7e0951e6afb7d55212eb096982a1.tar.gz |
ranger.container.keymap: added some documentation
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/container/keybuffer.py | 2 | ||||
-rw-r--r-- | ranger/container/keymap.py | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/ranger/container/keybuffer.py b/ranger/container/keybuffer.py index 50914f84..ce391de4 100644 --- a/ranger/container/keybuffer.py +++ b/ranger/container/keybuffer.py @@ -18,7 +18,7 @@ from collections import deque from string import digits from ranger.ext.keybinding_parser import parse_keybinding, \ DIRKEY, ANYKEY, PASSIVE_ACTION -from ranger.container.keymap import Binding, KeyMap +from ranger.container.keymap import Binding, KeyMap # mainly for assertions MAX_ALIAS_RECURSION = 20 diff --git a/ranger/container/keymap.py b/ranger/container/keymap.py index 167ba160..e44fcfd7 100644 --- a/ranger/container/keymap.py +++ b/ranger/container/keymap.py @@ -22,7 +22,24 @@ DIRARG = 'dir' ALIASARG = 'alias' class CommandArgs(object): - """The arguments which are passed to a keybinding function""" + """ + A CommandArgs object is passed to the keybinding function. + + This object simply aggregates information about the pressed keys + and the current environment. + + Attributes: + fm: the FM instance + wdg: the currently focused widget (or fm, if none is focused) + keybuffer: the keybuffer object + n: the prefixed number, eg 5 in the command "5yy" + directions: a list of directions which are entered for "<dir>" + direction: the first direction object from that list + keys: a string representation of the keybuffer + matches: all keys which are entered for "<any>" + match: the first match + binding: the used Binding object + """ def __init__(self, fm, widget, keybuf): self.fm = fm self.wdg = widget @@ -40,6 +57,7 @@ class CommandArgs(object): return CommandArgs(widget.fm, \ widget, widget.env.keybuffer) + class KeyMap(Tree): """Contains a tree with all the keybindings""" def map(self, *args, **keywords): |