관리-도구
편집 파일: etree_lxml.cpython-38.opt-1.pyc
U ��.e� � @ s� d dl mZmZmZ d dlmZ d dlmZ ddlm Z ddl mZ ddl mZ d d � Z G dd� de�ZG d d� de�ZG dd� de�ZG dd� de�ZG dd� dej�ZdS )� )�absolute_import�division�unicode_literals)� text_type)�etree� )� tag_regexp� )�base)� _ihatexmlc C s* | d krd S t | t�r| S | �dd�S d S )N�ascii�strict)� isinstancer �decode)�s� r �O/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.py� ensure_str s r c @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S ) �Rootc C s� || _ g | _z:|jjrD| j�t| t|jj�t|jj�t|jj ��� W n t k rZ Y nX z|�� }W n t k r� |}Y nX |�� d k r�|�� }q�|d k r�| j�|� |� � }q�d | _d | _d S �N)Zelementtree�childrenZdocinfoZinternalDTD�append�Doctyper Z root_name� public_idZ system_url�AttributeErrorZgetrootZgetprevious�getnext�text�tail)�selfZet�noder r r �__init__ s, � z Root.__init__c C s | j | S r )r �r �keyr r r �__getitem__1 s zRoot.__getitem__c C s d S r r �r r r r r 4 s zRoot.getnextc C s dS �Nr r r$ r r r �__len__7 s zRoot.__len__N)�__name__� __module__�__qualname__r r# r r&