History Base Class – xonsh.history.base
¶
Base class of Xonsh History backends.
-
class
xonsh.history.base.
History
(sessionid=None, **kwargs)[source]¶ Xonsh history backend base class.
History objects should be created via a subclass of History.
Attributes
rtns (sequence of ints) The return of the command (ie, 0 on success) inps (sequence of strings) The command as typed by the user, including newlines tss (sequence of two-tuples of floats) The timestamps of when the command started and finished, including fractions outs (sequence of strings) The output of the command, if xonsh is configured to save it gc (A garbage collector or None) The garbage collector In all of these sequences, index 0 is the oldest and -1 (the last item) is the newest. Represents a xonsh session’s history.
Parameters: sessionid : int, uuid, str, optional
Current session identifier, will generate a new sessionid if not set.
-
append
(cmd)[source]¶ Append a command item into history.
Parameters: cmd: dict
This dict contains information about the command that is to be added to the history list. It should contain the keys
inp
,rtn
andts
. These key names mirror the same names defined as instance variables in theHistoryEntry
class.
-
-
class
xonsh.history.base.
HistoryEntry
[source]¶ Represent a command in history.
Attributes
cmd: str The command as typed by the user, including newlines out: str The output of the command, if xonsh is configured to save it rtn: int The return of the command (ie, 0 on success) ts: two-tuple of floats The timestamps of when the command started and finished, including fractions.