관리-도구
편집 파일: diff.cpython-38.pyc
U *�e�v � @ s� d dl Z d dlmZ d dlmZ d dlZddgZzd dlmZ W n e k r` d dlmZ Y nX zeZ W n ek r� eZ Y nX ze W n ek r� eZY nX dd� Zefd d�Zd d� Zdd � Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdhdd�Zdd� ZG dd� d�ZG d d!� d!�ZG d"d#� d#e�Z d$d%� Z!d&d'� Z"d(d)� Z#d*d+� Z$d,d-� Z%d.d/� Z&G d0d1� d1e �Z'G d2d3� d3e'�Z(G d4d5� d5e'�Z)did7d8�Z*djd9d:�Z+e�,d;ej-ej.B �Z/e�,d<ej-ej.B �Z0e�,d=ej-ej.B �Z1d>d?� Z2e�,d@�Z3dAdB� Z4dCdD� Z5dEZ6dFZ7dGZ8dkdHdI�Z9e�,dJej:�Z;dKdL� Z<e�,dM�Z=dNdO� Z>dPdQ� Z?dRdS� Z@dTdU� ZAdVdW� ZBdXdY� ZCdldZd[�ZDd\d]� ZEd^d_� ZFd`da� ZGdbdc� ZHG ddde� dee jI�ZJeKdfk�r�d dglmLZL eL�M� dS )m� N)�etree)�fragment_fromstring� html_annotate�htmldiff)�escapec C s dt t|�d�| f S )Nz<span title="%s">%s</span>� )�html_escape�_unicode)�text�version� r �>/opt/hc_python/lib64/python3.8/site-packages/lxml/html/diff.py�default_markup s �r c C sV dd� | D �}|d }|dd� D ]}t ||� |}q"t|�}t||�}d�|��� S )a doclist should be ordered from oldest to newest, like:: >>> version1 = 'Hello World' >>> version2 = 'Goodbye World' >>> print(html_annotate([(version1, 'version 1'), ... (version2, 'version 2')])) <span title="version 2">Goodbye</span> <span title="version 1">World</span> The documents must be *fragments* (str/UTF8 or unicode), not complete documents The markup argument is a function to markup the spans of words. This function is called like markup('Hello', 'version 2'), and returns HTML. The first argument is text and never includes any markup. The default uses a span with a title: >>> print(default_markup('Some Text', 'by Joe')) <span title="by Joe">Some Text</span> c S s g | ]\}}t ||��qS r )�tokenize_annotated)�.0�docr r r r � <listcomp><