ó œ]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((s</usr/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*((s</usr/lib64/python2.7/site-packages/lxml/html/_diffcommand.pyR8s   s s cCs}tj|ƒ}|r8||jƒ }||jƒ}ntj|ƒ}|rp||jƒ}||jƒ }n|||fS(N(t body_start_retsearchtendt body_end_retstart(thtmltmatchR&R(((s</usr/lib64/python2.7/site-packages/lxml/html/_diffcommand.pyRIscCsdGHtjdƒdS(NsNot yet implementedi(RR(R R((s</usr/lib64/python2.7/site-packages/lxml/html/_diffcommand.pyRTs(toptparseRtreR/tlxml.html.diffRRt OptionParserRt add_optionRR+RtcompiletItSR5R8RR(((s</usr/lib64/python2.7/site-packages/lxml/html/_diffcommand.pyts6