Your IP : 216.73.216.52


Current Path : /opt/alt/python37/lib64/python3.7/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/Tools/scripts/__pycache__/diff.cpython-37.pyc

B

� f��@sVdZddlZddlZddlZddlZddlmZmZdd�Zdd�Ze	dkrRe�dS)	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)�datetime�timezonecCs"t�t�|�jtj�}|����S)N)	rZ
fromtimestamp�os�stat�st_mtimerZutcZ
astimezoneZ	isoformat)�path�t�r	�7/opt/alt/python37/lib64/python3.7/Tools/scripts/diff.py�
file_mtimesrc	Cs^t��}|jddddd�|jddddd�|jdddd	d�|jd
dddd�|jdd
tddd�|�d�|�d�|��}|j}|j}|j}t|�}t|�}t	|��}|�
�}WdQRXt	|��}	|	�
�}
WdQRX|jr�tj
||
|||||d�}nT|j�rt�||
�}n>|j�r6t��j||
|||j|d�}ntj||
|||||d�}tj�|�dS)Nz-c�
store_trueFz'Produce a context format diff (default))�action�default�helpz-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--lines�z'Set number of context lines (default 3))�typerr�fromfile�tofile)�n)�contextZnumlines)�argparse�ArgumentParser�add_argument�int�
parse_args�linesrrr�open�	readlines�u�difflibZunified_diffrZndiff�mZHtmlDiffZ	make_file�cZcontext_diff�sys�stdout�
writelines)�parserZoptionsrrrZfromdateZtodateZffZ	fromlinesZtfZtolinesZdiffr	r	r
�mains>







r&�__main__)
�__doc__r"rrrrrrr&�__name__r	r	r	r
�<module>	s (