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

# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

 
Classes
       
__builtin__.object
Command
AliasedCommand
CommandArgument
CommandList
Show

 
class AliasedCommand(Command)
    
Method resolution order:
AliasedCommand
Command
__builtin__.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(__builtin__.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(__builtin__.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(__builtin__.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
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.
show(self, *keys, **keywords)
create a Show object and assign it to the given key combinations.
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 Show(__builtin__.object)
    Show objects do things without clearing the keybuffer
 
  Methods defined here:
__init__(self, dictionary, 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)