관리-도구
편집 파일: etree_lxml.cpython-36.pyc
3 �Re� � @ s� d dl mZmZmZ d dlmZ d dlmZ d dlm Z ddl mZ ddlm Z dd lmZ d d� ZG dd � d e�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de j�ZdS )� )�absolute_import�division�unicode_literals)� text_type)�OrderedDict)�etree� )� tag_regexp� )�base)� _ihatexmlc C s* | d krd S t | t�r| S | jdd�S d S )N�ascii�strict)� isinstancer �decode)�s� r ��/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/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 | _y:|jjrD| jjt| t|jj�t|jj�t|jj ��� W n t k rZ Y nX y|j� }W n t k r� |}Y nX x|j� d k r�|j� }q�W x |d k r�| jj|� |j � }q�W d | _d | _d S )N)Zelementtree�childrenZdocinfoZinternalDTD�append�Doctyper Z root_name� public_idZ system_url�AttributeError�getrootZgetprevious�getnext�text�tail)�self�et�noder r r �__init__ s* z Root.__init__c C s | j | S )N)r )r �keyr r r �__getitem__3 s zRoot.__getitem__c C s d S )Nr )r r r r r 6 s zRoot.getnextc C s dS )Nr r )r r r r �__len__9 s zRoot.__len__N)�__name__� __module__�__qualname__r"