U e! @ s d dl Z d dlZd dlZd dlZddlmZ dZe jdedZej ddd d ddd ej dddddd dddZ dd Zedej ejB Zedej ejB Zdd Zdd ZdS ) N )htmldiff zR%prog [OPTIONS] FILE1 FILE2 %prog --annotate [OPTIONS] INFO1 FILE1 INFO2 FILE2 ...)usagedescriptionz-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 5 Q R X d S )Nr zError: you must give two filesr wb)sysargvparser parse_argsr annotatelenprint print_helpexit read_file split_bodyr r endswithstdoutwriteopen)argsoptionsZfile1Zfile2Zinput1Zinput2Zbody1preZbody2postresultf r) F/opt/hc_python/lib64/python3.8/site-packages/lxml/html/_diffcommand.pymain s, r+ c C sP | dkrt j }n8tj| s.td| nt| d}| }W 5 Q R X |S )Nr zInput file %s does not existrb)r stdinreadospathexistsOSErrorr" )filenamecr( r) r) r* r 7 s r z