ranger.container.commandlist
index
/home/hut/work/ranger/ranger/container/commandlist.py

# Copyright (c) 2009, 2010 hut <hut@lavabit.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

 
Classes
       
builtins.object
Command
AliasedCommand
CommandArgument
CommandList
Hint

 
class AliasedCommand(Command)
    
Method resolution order:
AliasedCommand
Command
builtins.object

Methods defined here:
__init__(self, getter, keys)
get_execute(self)

Data descriptors defined here:
execute

Methods inherited from Command:
execute_wrap(self, displayable)

Data descriptors inherited from Command:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from Command:
keys = []

 
class Command(builtins.object)
    Command objects store information about a command
 
  Methods defined here:
__init__(self, fnc, keys)
execute(self, *args)
Execute the command
execute_wrap(self, displayable)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
keys = []

 
class CommandArgument(builtins.object)
     Methods defined here:
__init__(self, fm, displayable, keybuffer)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class CommandList(builtins.object)
    CommandLists are dictionary-like objects which give you a command
for a given key combination.  CommandLists must be filled before use.
 
  Methods defined here:
__getitem__(self, key)
Returns the command with the given key combination
__init__(self)
alias(self, existing, *new)
bind the <new> keys to the command of the <existing> key
bind(self, fnc, *keys)
create a Command object and assign it to the given key combinations.
clear(self)
remove all bindings
hint(self, text, *keys)
create a Hint object and assign it to the given key combinations.
rebuild_paths(self)
Fill the path dictionary with dummie objects.
We need to know when to clear the keybuffer (when a wrong key is pressed)
and when to wait for the rest of the key combination.  For "gg" we
will assign "g" to a dummy which tells the program to do the latter
and wait.
remove_dummies(self)
Remove dummie objects in case you have to rebuild a path dictionary
which already contains dummie objects.
unbind(self, *keys)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
commandlist = []
dummies_in_paths = False
dummy_object = None
paths = {}

 
class Hint(builtins.object)
    Hints display text without clearing the keybuffer
 
  Methods defined here:
__init__(self, text, keys)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
keys = []
text = ''

 
Functions
       
cmdarg(displayable)