B Q4]O@sVdZddlZddlZddlZddlZddlmZmZddZddZe dkrRedS) aS Command line interface to difflib.py providing diffs in four formats: * ndiff: lists every line and highlights interline changes. * context: highlights clusters of changes in a before/after format. * unified: highlights clusters of changes in an inline format. * html: generates side by side comparison with change highlights. N)datetimetimezonecCs"tt|jtj}|S)N) rZ fromtimestamposstatst_mtimerZutcZ astimezoneZ isoformat)pathtr 7/opt/alt/python37/lib64/python3.7/Tools/scripts/diff.py file_mtimesr c Cs^t}|jddddd|jddddd|jdddd d|jd ddd d|jd d tddd|d|d|}|j}|j}|j}t|}t|}t |}| }WdQRXt |} | } WdQRX|j rt j || |||||d} nT|jrt || } n>|jr6t j|| |||j|d} nt j|| |||||d} tj| dS)Nz-c store_trueFz'Produce a context format diff (default))actiondefaulthelpz-uzProduce a unified format diffz-mzAProduce HTML side by side diff (can use -c and -l in conjunction)z-nzProduce a ndiff format diffz-lz--linesz'Set number of context lines (default 3))typerrfromfiletofile)n)contextZnumlines)argparseArgumentParser add_argumentint parse_argslinesrrr open readlinesudifflibZ unified_diffrZndiffmZHtmlDiffZ make_filecZ context_diffsysstdout writelines) parserZoptionsrrrZfromdateZtodateZffZ fromlinesZtfZtolinesZdiffr r r mains>         r&__main__) __doc__r"rrrrrr r&__name__r r r r  s  (