
    ,h!                     x   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      Zej                  ddd	d
dd       ej                  ddddd       ddZ
d Z ej                  dej                  ej                  z        Z ej                  dej                  ej                  z        Zd Zd Zy)    N   )htmldiff zR%prog [OPTIONS] FILE1 FILE2
%prog --annotate [OPTIONS] INFO1 FILE1 INFO2 FILE2 ...)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                    | t         j                  dd  } t        j                  |       \  }} |j                  rt        ||       S t        |       dk7  r4t        d       t        j                          t        j                  d       | \  }}t        |      }t        |      }t        |      d   }t        |      \  }}}	t        ||      }
||
z   |	z   }
|j                  dk(  r6|
j                  d      s|
dz  }
t         j                  j!                  |
       y t#        |j                  d      5 }|j!                  |
       d d d        y # 1 sw Y   y xY w)Nr      zError: you must give two filesr
   
wb)sysargvparser
parse_argsr   annotatelenprint
print_helpexit	read_file
split_bodyr   r	   endswithstdoutwriteopen)argsoptionsfile1file2input1input2body1prebody2postresultfs               X/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/lxml/html/_diffcommand.pymainr2      s%   |xx|%%d+MGT&&
4yA~./LE5uFuFvq!E!&)CeU#F6\D F~~t$dNF

 '..$' 	1GGFO	 	 	s   /E

Ec                    | dk(  r t         j                  j                         }|S t        j                  j                  |       st        d| z        t        | d      5 }|j                         }d d d        |S # 1 sw Y   S xY w)Nr
   zInput file %s does not existrb)r   stdinreadospathexistsOSErrorr$   )filenamecr0   s      r1   r   r   7   sz    3IINN H WW^^H%*X57 	7 (D! 	QA	H	Hs   A::Bz	<body.*?>z
</body.*?>c                    dx}}t         j                  |       }|r&| d |j                          }| |j                         d  } t        j                  |       }|r&| |j	                         d  }| d |j	                          } || |fS )Nr   )body_start_researchendbody_end_restart)htmlr,   r.   matchs       r1   r    r    G   s    OC$  &E<EIIK EIIKL!t$EEKKMN#NU[[]#d?    c                 D    t        d       t        j                  d       y )NzNot yet implementedr   )r   r   r   )r&   r%   s     r1   r   r   S   s    	
 HHQKrE   )N)optparser   rer7   diffr   r   OptionParserr   
add_optionr2   r   compileISr>   rA   r    r    rE   r1   <module>rP      s     
 	 	  
		=
   *		*     .			  2	 

"$$rtt)bjj2449
rE   