Server IP : 184.154.167.98 / Your IP : 13.59.135.139 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 8.2.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib64/python3.6/site-packages/lxml/__pycache__/ |
Upload File : |
3 �0�Z� � @ s� d Z ddlmZ yddlmZ ddlmZ W n, ek rX ddlmZ ddl mZ Y nX dZ e d Ze d Ze d Z G d d � d ej�Zddd �Zddd�Zdd� Zddd�Zddd�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}�includeZfallback�*c @ s e Zd ZdS )�FatalIncludeErrorN)�__name__� __module__�__qualname__� r r �&/usr/lib64/python3.6/ElementInclude.pyr G s r Nc C sH t | d�}|dkr"tj|�j� }n|j� }|s2d}|j|�}|j� |S )N�rb�xmlzutf-8)�openr �parse�getroot�read�decode�close)�hrefr �encoding�file�datar r r �default_loaderW s r c C s\ |dkrt j| |�j� }n>d| kr,t| �}n t| d�}|j� }|j� |sNd}|j|�}|S )Nr z://r zutf-8)r r r r r r r r )r r r �parserr �fr r r �_lxml_default_loaderg s r c s d� fdd� }|S )Nc s � | ||�S )Nr )r r r r )�loaderr r �loadz s z_wrap_et_loader.<locals>.load)NNr )r r r )r r �_wrap_et_loadery s r c C s` |d kr<t | d�r | }| j� } n| j� }t |d�rN|jj}nt | d�rN| j� } t| ||d� d S )Nr �docinfo)�base_url)�hasattrr �getroottreer ZURL�_include)�elemr r! Ztreer r r r � s c C s� |d k rt |�}nt}|d kr$t� }| j� j}t| jt��}�x�|D �]�}|jt k�r�t ||jd��}|jdd�} |j� } | dk�r||kr�t d| ��|j|� ||| |d�}|d kr�t d|| f ��t|||�}|jr�|jp�d|j |_| d kr�|S | j||� n�| dk�r�||| |jd �d �}|d k�r>t d|| f ��|j� } | d k �rd| j�pZd| | _n,| d k�rr|S | j�p|d| |j�p�d | _| j|� nt d| ��qD|jtk�r�|j� } | d k �r�| jt k�r�t d|j ��qDt d |j ��qDW | S )Nr r r z recursive include of %r detected)r zcannot load %r as %r� �textr )r z)unknown parse type in xi:include tag (%r)z0xi:fallback tag must be child of xi:include (%r)z0Invalid element found in XInclude namespace (%r))r r �setr# r �list�iter�XINCLUDE_ITER_TAG�tag�XINCLUDE_INCLUDEr �getZ getparentr �addr$ �tail�replaceZgetpreviousr'