History Diff’er (xonsh.diff_history)

Tools for diff’ing two xonsh history files in a meaningful fashion.

class xonsh.diff_history.HistoryDiffer(afile, bfile, reopen=False, verbose=False)[source]

This class helps diff two xonsh history files.

Parameters:

afile : file handle or str

The first file to diff

bfile : file handle or str

The second file to diff

reopen : bool, optional

Whether or not to reopen the file handles each time. The default here is opposite from the LazyJSON default because we know that we will be doing a lot of reading so it is best to keep the handles open.

verbose : bool, optional

Whether to print a verbose amount of information.

cmdsdiff()[source]

Computes the difference of the commands themselves.

envdiff()[source]

Computes the difference between the environments.

format()[source]

Formats the difference between the two history files.

header()[source]

Computes a header string difference.

xonsh.diff_history.bold_str_diff(a, b, sm=None)[source]
xonsh.diff_history.dh_create_parser(p=None)[source]
xonsh.diff_history.dh_main_action(ns, hist=None, stdout=None, stderr=None)[source]
xonsh.diff_history.greenline(line)[source]
xonsh.diff_history.highlighted_ndiff(a, b)[source]

Returns a highlited string, with bold charaters where different.

xonsh.diff_history.redline(line)[source]