HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //usr/local/lib64/python3.6/site-packages/lxml/html/__pycache__/_diffcommand.cpython-36.pyc
3

��?eI�@s�ddlmZddlZddlZddlZddlZddlmZdZej	ded�Z
e
jdd	d
ddd
d�e
jdddddd�ddd�Zdd�Z
ejdejejB�ZejdejejB�Zdd�Zdd�ZdS) �)�absolute_importN�)�htmldiff�zR%prog [OPTIONS] FILE1 FILE2
%prog --annotate [OPTIONS] INFO1 FILE1 INFO2 FILE2 ...)�usage�descriptionz-oz--output�FILE�output�-zFile to write the difference to)�metavar�dest�default�helpz-az--annotation�
store_true�
annotationzDo an annotation)�actionrrc	Cs�|dkrtjdd�}tj|�\}}|jr4t||�St|�dkrZtd�tj�tj	d�|\}}t
|�}t
|�}t|�d}t|�\}}}	t||�}
||
|	}
|j
dkr�|
jd�s�|
d7}
tjj|
�n"t|j
d��}|j|
�WdQRXdS)Nr�zError: you must give two filesr
�
�wb)�sys�argv�parser�
parse_argsr�annotate�len�print�
print_help�exit�	read_file�
split_bodyrr	�endswith�stdout�write�open)�args�options�file1�file2Zinput1Zinput2Zbody1�preZbody2�post�result�f�r,�6/tmp/pip-build-_veujq9v/lxml/lxml/html/_diffcommand.py�main s,




r.c	CsP|dkrtjj�}n8tjj|�s.td|��nt|d��}|j�}WdQRX|S)Nr
zInput file %s does not exist�rb)r�stdin�read�os�path�exists�OSErrorr#)�filename�cr+r,r,r-r9srz	<body.*?>z
</body.*?>cCsnd}}tj|�}|r6|d|j��}||j�d�}tj|�}|rd||j�d�}|d|j��}|||fS)Nr)�
body_start_re�search�end�body_end_re�start)�htmlr(r)�matchr,r,r-rIs

rcCstd�tjd�dS)NzNot yet implementedr)rrr)r%r$r,r,r-rUsr)N)�
__future__r�optparser�rer2Zdiffrr�OptionParserr�
add_optionr.r�compile�I�Sr8r;rrr,r,r,r-�<module>s8