Readline history support.
Interface to the readline history.
This class is not intended for instantiation beyond the one history object in this module. Typically, applications will import the history object and use its properties and methods to work with readline history:
from rl import history
history.max_entries = 300
history.read_file(histfile)
History entries can be accessed like elements in a Python list. The item at index 0 is the oldest, the item at -1 the most recent history entry:
if current != history[-1]:
history.append(current)
The maximum number of history entries kept. Beyond this point the history list is truncated by removing the oldest entry. A negative value means no limit. Defaults to -1.
Clear the history.
Append a line to the history.
The current history length.
Return the history item at index.
Replace the history item at index.
Remove the history item at index.
Iterate over history items.
Reverse-iterate over history items.
Load a readline history file. The default filename is ~/.history. If raise_exc is True, IOErrors will be allowed to propagate.
Save a readline history file. The default filename is ~/.history. If raise_exc is True, IOErrors will be allowed to propagate.
Clear the history and reset all variables to their default values.