Replay History (xonsh.replay)

Tools to replay xonsh history files.

class xonsh.replay.Replayer(f, reopen=True)[source]

Replays a xonsh history file.

ffile handle or str

Path to xonsh history file.

reopenbool, optional

Whether new file handle should be opened for each load, passed directly into LazyJSON class.

replay(merge_envs=('replay', 'native'), target=None)[source]

Replays the history specified, returns the history object where the code was executed.

merge_envtuple of str or Mappings, optional

Describes how to merge the environments, in order of increasing precedence. Available strings are ‘replay’ and ‘native’. The ‘replay’ env comes from the history file that we are replaying. The ‘native’ env comes from what this instance of xonsh was started up with. Instead of a string, a dict or other mapping may be passed in as well. Defaults to (‘replay’, ‘native’).

targetstr, optional

Path to new history file.

xonsh.replay.replay_main(args, stdin=None)[source]

Acts as main function for replaying a xonsh history file.

xonsh.replay.replay_main_action(h, ns, stdout=None, stderr=None)[source]