Replay History (xonsh.replay)

Tools to replay xonsh history files.

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

Replays a xonsh history file.

Parameters:

f : file handle or str

Path to xonsh history file.

reopen : bool, 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.

Parameters:

merge_env : tuple of str or Mappings, optional

Describes how to merge the environments, in order of increasing precednce. 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’).

target : str, optional

Path to new history file.

xonsh.replay.replay_create_parser(p=None)[source]
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]