509318396
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3
¹'¾YW  ã               @   sÂ   d dl mZ d dlZd dlZd dlZd dlZddlmZ dZej	ded�Z
e
jdd	d
dddd� e
jdddddd� ddd„Zdd„ ZejdejejB ƒZejdejejB ƒZdd„ Zdd„ ZdS ) é    )Úabsolute_importNé   )ÚhtmldiffÚ zR%prog [OPTIONS] FILE1 FILE2
%prog --annotate [OPTIONS] INFO1 FILE1 INFO2 FILE2 ...)ZusageÚdescriptionz-oz--outputÚFILEÚoutputú-zFile to write the difference to)ÚmetavarÚdestÚdefaultÚhelpz-az--annotationÚ
store_trueÚ
annotationzDo an annotation)Úactionr   r   c             C   sî   | d krt jdd … } tj| ƒ\}} |jr4t|| ƒS t| ƒdkrZtdƒ tjƒ  t j	dƒ | \}}t
|ƒ}t
|ƒ}t|ƒd }t|ƒ\}}}	t||ƒ}
||
 |	 }
|jdkrÌ|
jdƒs¾|
d7 }
t jj|
ƒ nt|jdƒ}|j|
ƒ |jƒ  d S )Nr   é   zError: you must give two filesr	   Ú
Úwb)ÚsysÚargvÚparserÚ
parse_argsr   ÚannotateÚlenÚprintZ
print_helpÚexitÚ	read_fileÚ
split_bodyr   r   ÚendswithÚstdoutÚwriteÚopenÚclose)ÚargsÚoptionsZfile1Zfile2Zinput1Zinput2Zbody1ÚpreZbody2ÚpostÚresultÚf© r)   ú$/usr/lib64/python3.6/_diffcommand.pyÚmain    s.    





r+   c             C   sL   | dkrt jjƒ }n4tjj| ƒs.td|  ƒ‚nt| dƒ}|jƒ }|jƒ  |S )Nr	   zInput file %s does not existÚrb)	r   ÚstdinÚreadÚosÚpathÚexistsÚOSErrorr!   r"   )ÚfilenameÚcr(   r)   r)   r*   r   :   s    
r   z	<body.*?>z
</body.*?>c             C   sn   d }}t j| ƒ}|r6| d |jƒ … }| |jƒ d … } tj| ƒ}|rd| |jƒ d … }| d |jƒ … } || |fS )Nr   )Úbody_start_reÚsearchÚendÚbody_end_reÚstart)Zhtmlr%   r&   Úmatchr)   r)   r*   r   K   s    

r   c             C   s   t dƒ tjdƒ d S )NzNot yet implementedr   )r   r   r   )r$   r#   r)   r)   r*   r   W   s    r   )N)Z
__future__r   Zoptparser   Úrer/   Zdiffr   r   ZOptionParserr   Z
add_optionr+   r   ÚcompileÚIÚSr5   r8   r   r   r)   r)   r)   r*   Ú<module>   s8   
