관리-도구
편집 파일: base.cpython-36.opt-1.pyc
3 �PfK � @ s� d dl mZmZmZ d dlmZ ddlmZmZm Z ddddd d ddd g Z ejZej ZejZejZejZejZdZdje �Z G dd� de�ZG dd � d e�ZdS )� )�absolute_import�division�unicode_literals)�Node� )� namespaces�voidElements�spaceCharacters�DOCUMENT�DOCTYPE�TEXT�ELEMENT�COMMENT�ENTITY�UNKNOWN� TreeWalker�NonRecursiveTreeWalkerz<#UNKNOWN#>� c @ sh e Zd Zdd� Zdd� Zdd� Zddd �Zd d� Zdd � Zdd� Z dd� Z ddd�Zdd� Zdd� Z dS )r c C s || _ d S )N)�tree)�selfr � r �/usr/lib/python3.6/base.py�__init__ s zTreeWalker.__init__c C s t �d S )N)�NotImplementedError)r r r r �__iter__ s zTreeWalker.__iter__c C s d|d�S )NZSerializeError)�type�datar )r �msgr r r �error s zTreeWalker.errorFc c s$ d|||d�V |r | j d�V d S )NZEmptyTag)r �name� namespacer zVoid element has children)r )r r r �attrs�hasChildrenr r r �emptyTag s zTreeWalker.emptyTagc C s d|||d�S )NZStartTag)r r r r r )r r r r! r r r �startTag% s zTreeWalker.startTagc C s d||d�S )NZEndTag)r r r r )r r r r r r �endTag+ s zTreeWalker.endTagc c sx |}|j t�}|d t|�t|� � }|r6d|d�V |}|jt�}|t|�d � }|rdd|d�V |rtd|d�V d S )NZSpaceCharacters)r r Z Characters)�lstripr �len�rstrip)r r Zmiddle�left�rightr r r �text0 s zTreeWalker.textc C s d|d�S )N�Comment)r r r )r r r r r �comment>