관리-도구
편집 파일: etree_lxml.cpython-36.opt-1.pyc
3 �Pf� � @ 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 | jdd�S d S )N�ascii�strict)� isinstancer �decode)�s� r � /usr/lib/python3.6/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�AttributeErrorZgetrootZgetprevious�getnext�text�tail)�selfZet�noder r r �__init__ s* z Root.__init__c C s | j | S )N)r )r �keyr r r �__getitem__1 s zRoot.__getitem__c C s d S )Nr )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"