B
MO]I @ s d dl mZ d dlZd dlZd dlZd dlZddlmZ dZej dedZ
e
jdd d
ddd
d e
jdddddd dddZdd Z
edejejB ZedejejB Zdd Zdd ZdS ) )absolute_importN )htmldiff zR%prog [OPTIONS] FILE1 FILE2
%prog --annotate [OPTIONS] INFO1 FILE1 INFO2 FILE2 ...)Zusagedescriptionz-oz--outputFILEoutput-zFile to write the difference to)metavardestdefaulthelpz-az--annotation
store_true
annotationzDo an annotation)actionr r
c C s | d krt jdd } t| \}} |jr4t|| S t| dkrZtd t t d | \}}t
|}t
|}t|d }t|\}}} t||}
||
| }
|j
dkr|
ds|
d7 }
t j|
n"t|j
d}||
W d Q R X d S )Nr zError: you must give two filesr
wb)sysargvparser
parse_argsr annotatelenprintZ
print_helpexit read_file
split_bodyr r endswithstdoutwriteopen)argsoptionsZfile1Zfile2Zinput1Zinput2Zbody1preZbody2postresultf r( I/opt/alt/python37/lib64/python3.7/site-packages/lxml/html/_diffcommand.pymain s,
r* c C sP | dkrt j }n8tj| s.td| nt| d}| }W d Q R X |S )Nr zInput file %s does not existrb)r stdinreadospathexistsOSErrorr! )filenamecr'