Module readline
[hide private]
[frames] | no frames]

Module readline

Importing this module enables command line editing using GNU readline.

Functions [hide private]
None
add_history(string)
add a line to the history buffer
None
clear_history()
Clear the current readline history.
int
get_begidx()
get the beginning index of the readline tab-completion scope
function
get_completer()
Returns current completer function.
string
get_completer_delims()
get the readline word delimiters for tab-completion
integer
get_current_history_length()
return the current (not the maximum) length of history.
int
get_endidx()
get the ending index of the readline tab-completion scope
string
get_history_item()
return the current contents of history item at index.
int
get_history_length()
return the maximum number of items that will be written to the history file.
string
get_line_buffer()
return the current contents of the line buffer.
None
insert_text(string)
Insert text into the command line.
None
parse_and_bind(string)
Parse and execute single line of a readline init file.
None
read_history_file(filename=...)
Load a readline history file.
None
read_init_file(filename=...)
Parse a readline initialization file.
None
redisplay()
Change what's displayed on the screen to reflect the current contents of the line buffer.
None
remove_history_item(pos)
remove history item given by its position
None
replace_history_item(pos, line)
replaces history item given by its position with contents of line
None
set_completer(function=...)
Set or remove the completer function.
None
set_completer_delims(string)
set the readline word delimiters for tab-completion
None
set_history_length(length)
set the maximal number of items which will be written to the history file.
None
set_pre_input_hook(function=...)
Set or remove the pre_input_hook function.
None
set_startup_hook(function=...)
Set or remove the startup_hook function.
None
write_history_file(filename=...)
Save a readline history file.
Function Details [hide private]

read_history_file(filename=...)

 

Load a readline history file. The default filename is ~/.history.

Returns: None

read_init_file(filename=...)

 

Parse a readline initialization file. The default filename is the last filename used.

Returns: None

set_completer(function=...)

 

Set or remove the completer function. The function is called as function(text, state), for state in 0, 1, 2, ..., until it returns a non-string. It should return the next possible completion starting with 'text'.

Returns: None

set_history_length(length)

 

set the maximal number of items which will be written to the history file. A negative length is used to inhibit history truncation.

Returns: None

set_pre_input_hook(function=...)

 

Set or remove the pre_input_hook function. The function is called with no arguments after the first prompt has been printed and just before readline starts reading input characters.

Returns: None

set_startup_hook(function=...)

 

Set or remove the startup_hook function. The function is called with no arguments just before readline prints the first prompt.

Returns: None

write_history_file(filename=...)

 

Save a readline history file. The default filename is ~/.history.

Returns: None