Package grizzled :: Module history :: Class ReadlineHistory
[hide private]
[frames] | no frames]

Class ReadlineHistory

source code

object --+    
         |    
   History --+
             |
            ReadlineHistory
Known Subclasses:

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
str
get_item(self, index)
Get an item from the history.
source code
int
get_total(self)
Get the total number number of commands in the history.
source code
 
set_completer_delims(self, s)
Set the completer delimiters--the characters that delimit tokens that are eligible for completion.
source code
str
get_completer_delims(self)
Get the completer delimiters--the characters that delimit tokens that are eligible for completion.
source code
 
remove_item(self, index)
Remove a line from the history buffer.
source code
 
clear_history(self)
Clear the history buffer.
source code
int
get_max_length(self)
Get the maximum length of the history.
source code
 
set_max_length(self, n)
Set the maximum length of the history.
source code
 
add_item(self, line, force=False)
Add (append) a line to the history buffer.
source code

Inherited from History: cut_back_to, get_history_list, get_last_item, get_last_matching_item, load_history_file, remove_matches, replace_history, save_history_file, show

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from History: maxLength, total

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

get_item(self, index)

source code 
Get an item from the history.
Parameters:
  • index - 0-based index of the item to get. The larger the index value, the more recent the entry
Returns: str
the item at that index
Raises:
  • IndexError - Index out of range
Overrides: History.get_item
(inherited documentation)

get_total(self)

source code 
Get the total number number of commands in the history. Identical to the total property.
Returns: int
the number of commands in the history
Overrides: History.get_total
(inherited documentation)

set_completer_delims(self, s)

source code 
Set the completer delimiters--the characters that delimit tokens that are eligible for completion.
Parameters:
  • s - The delimiters
Overrides: History.set_completer_delims
(inherited documentation)

get_completer_delims(self)

source code 
Get the completer delimiters--the characters that delimit tokens that are eligible for completion.
Returns: str
the delimiters
Overrides: History.get_completer_delims
(inherited documentation)

remove_item(self, index)

source code 
Remove a line from the history buffer. Subclasses must provide an implementation of this method.
Parameters:
  • i - the 0-based index of the item to be removed
Overrides: History.remove_item
(inherited documentation)

clear_history(self)

source code 
Clear the history buffer. Subclasses must provide an implementation of this method.
Overrides: History.clear_history
(inherited documentation)

get_max_length(self)

source code 
Get the maximum length of the history. This isn't the maximum number of entries in the in-memory history buffer; instead, it's the maximum number of entries that will be saved to the history file. Subclasses must provide an implementation of this method.
Returns: int
the maximum saved size of the history
Overrides: History.get_max_length
(inherited documentation)

set_max_length(self, n)

source code 
Set the maximum length of the history. This isn't the maximum number of entries in the in-memory history buffer; instead, it's the maximum number of entries that will be saved to the history file. Subclasses must provide an implementation of this method.
Parameters:
  • n - the maximum saved size of the history
Overrides: History.set_max_length
(inherited documentation)

add_item(self, line, force=False)

source code 
Add (append) a line to the history buffer. Subclasses must provide an implementation of this method.
Parameters:
  • line - the command to append to the history
Overrides: History.add_item
(inherited documentation)