� �]Nc @s ddlZddlZddlZddlZddlmZdZejddde�Zej ddd d d d d ddd�ej ddddd ddd�dd�Z d�Z ej dejejB�Zej dejejB�Zd�Zd�ZdS(i����N(thtmldiffttusagesR%prog [OPTIONS] FILE1 FILE2 %prog --annotate [OPTIONS] INFO1 FILE1 INFO2 FILE2 ...t descriptions-os--outputtmetavartFILEtdesttoutputtdefaultt-thelpsFile to write the difference tos-as --annotationtactiont store_truet annotationsDo an annotationc CsI|dkrtjd}ntj|�\}}|jrGt||�St|�dkrxdGHtj�tj d�n|\}}t |�}t |�}t |�d}t |�\}}} t ||�} || | } |j dkr| jd�s | d7} ntjj| �n)t|j d�} | j| �| j�dS(NiisError: you must give two filesR s twb(tNonetsystargvtparsert parse_argsR tannotatetlent print_helptexitt read_filet split_bodyRRtendswithtstdouttwritetopentclose( targstoptionstfile1tfile2tinput1tinput2tbody1tpretbody2tposttresulttf((sI/opt/alt/python27/lib64/python2.7/site-packages/lxml/html/_diffcommand.pytmains.         cCsl|dkrtjj�}nJtjj|�sCtd|��n%t|d�}|j�}|j�|S(NR sInput file %s does not existtrb( RtstdintreadtostpathtexiststOSErrorRR(tfilenametcR*((sI/opt/alt/python27/lib64/python2.7/site-packages/lxml/html/_diffcommand.pyR8s   s <body.*?>s </body.*?>cCs}tj|�}|r8||j� }||j�}ntj|�}|rp||j�}||j� }n|||fS(N(t body_start_retsearchtendt body_end_retstart(thtmltmatchR&R(((sI/opt/alt/python27/lib64/python2.7/site-packages/lxml/html/_diffcommand.pyRIscCsdGHtjd�dS(NsNot yet implementedi(RR(R R((sI/opt/alt/python27/lib64/python2.7/site-packages/lxml/html/_diffcommand.pyRTs(toptparseRtreR/tlxml.html.diffRRt OptionParserRt add_optionRR+RtcompiletItSR5R8RR(((sI/opt/alt/python27/lib64/python2.7/site-packages/lxml/html/_diffcommand.pyt<module>s6