rl
rl exports the following components:
rl.completer <rl.Completer>
Interface to the readline completer. Used to configure the completion aspects of readline.
rl.completion <rl.Completion>
Interface to the active readline completion. Used to interact with readline when a completion is in progress.
rl.history <rl.History>
Interface to the readline history. Used to read and write history files and to manipulate history entries.
rl.readline
The readline bindings module. Contains everything known from the standard library plus extensions specific to the rl package. The
completer <rl.Completer>
,completion <rl.Completion>
, andhistory <rl.History>
interfaces make use of this module, and you should rarely need to interact with it directly.rl.generator
A decorator turning any callable into a completion entry function that can be handed to readline.
rl.print_exc
A decorator printing exceptions to stderr. Useful when writing Python completions and hooks, as exceptions occurring there are usually swallowed by the in-between C code.
Completion is the process initiated when the user presses the TAB key. It has three phases: Word breaking, match generation, and match insertion/display.
For each phase, readline provides configuration settings and hooks that allow applications to control the way the library behaves. See the completer <rl.Completer>
and completion <rl.Completion>
objects for detailed descriptions of available properties.
A calling sequence for filename completion may look like this:
complete_internal
find_completion_word
~rl.Completer.word_break_hook
~rl.Completer.char_is_quoted_function
gen_completion_matches
~rl.Completer.completer
~rl.Completion.complete_filename
~rl.Completer.directory_rewrite_hook
or~rl.Completer.directory_completion_hook
~rl.Completer.filename_dequoting_function
~rl.Completer.filename_rewrite_hook
~rl.Completer.ignore_some_completions_function
insert_match
~rl.Completer.filename_quoting_function
~rl.Completer.filename_stat_hook
display_matches
~rl.Completer.display_matches_hook
~rl.Completion.display_match_list
~rl.Completer.directory_completion_hook
or~rl.Completer.filename_stat_hook
History allows readline to save and later recall lines the user has entered. The history <rl.History>
object provides a list-like interface to the history buffer as well as functions to persist the history between sessions.
The GNU Readline Library and the GNU History Library.