Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/Tools/scripts/__pycache__/diff.cpython-35.pyc



��Yf��@s�dZddlZddlZddlZddlZddlZddlmZmZdd�Zdd�Z	e
dkr�e	�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�timezonecCs1tjtj|�jtj�}|j�j�S)N)	rZ
fromtimestamp�os�stat�st_mtimerZutcZ
astimezoneZ	isoformat)�path�t�r	�7/opt/alt/python35/lib64/python3.5/Tools/scripts/diff.py�
file_mtimesrcCstj�}|jddddddd�|jddddddd	�|jd
dddddd�|jddddddd
�|jdddtdddd�|jd�|jd�|j�}|j}|j}|j}t|�}t|�}t	|��}|j
�}WdQRXt	|��}	|	j
�}
WdQRX|jrwtj
||
||||d|�}n{|jr�tj||
�}n]|jr�tj�j||
||d|jd|�}n$tj||
||||d|�}tjj|�dS)Nz-c�action�
store_true�defaultF�helpz'Produce a context format diff (default)z-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�type�z'Set number of context lines (default 3)�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>

				'		0$r&�__main__)�__doc__r"rZtimerrrrrr&�__name__r	r	r	r
�<module>	s<(