관리-도구
편집 파일: ElementInclude.cpython-37.pyc
B o��]p! � @ s� d Z ddlmZ yddlmZ ddlmZ W n, ek rX ddlmZ ddl mZ Y nX dZ e d Ze d Ze d Z d ZG d d� dej�ZG dd � d e�Zddd�Zddd�Zdd� Zddefdd�Zddedfdd�ZdS )a Limited XInclude support for the ElementTree package. While lxml.etree has full support for XInclude (see `etree.ElementTree.xinclude()`), this module provides a simpler, pure Python, ElementTree compatible implementation that supports a simple form of custom URL resolvers. � )�etree)�urljoin)�urlopenz!{http://www.w3.org/2001/XInclude}�include�fallback�*� c @ s e Zd ZdS )�FatalIncludeErrorN)�__name__� __module__�__qualname__� r r �F/opt/alt/python37/lib64/python3.7/site-packages/lxml/ElementInclude.pyr K s r c @ s e Zd ZdS )�LimitedRecursiveIncludeErrorN)r r r r r r r r O s r Nc C sH t | d�}|dkr"t�|��� }n|�� }|s2d}|�|�}|�� |S )N�rb�xmlzutf-8)�openr �parse�getroot�read�decode�close)�hrefr �encoding�file�datar r r �default_loader` s r c C s\ |dkrt �| |��� }n>d| kr,t| �}n t| d�}|�� }|�� |sNd}|�|�}|S )Nr z://r zutf-8)r r r r r r r r )r r r �parserr �fr r r �_lxml_default_loaderq s r c s d� fdd� }|S )Nc s � | ||�S )Nr )r r r r )�loaderr r �load� s z_wrap_et_loader.<locals>.load)NNr )r r! r )r r �_wrap_et_loader� s r"