Your IP : 13.58.191.60
o
6��f,
� @ s� d dl Z d dlZd dlmZmZmZmZ d dlT d dlm Z m
Z
ejjj
ejjjfZG dd� dejj�Zeeddd � eed
dd � eedd
d � dd� Zdd� Zdd� Zdd� Zdd� ZG dd� de�ZG dd� de�Zeeddd � eeddd � eedd d � G d!d"� d"e�Zeed#d$d � eZG d%d&� d&e�Zedd�ZG d'd(� d(e�Zeed)d*d � eedd+d � d,d-� ZG d.d/� d/�ZG d0d1� d1ee�Z G d2d3� d3ee�Z!ee!d#d4d � G d5d6� d6e!�Z"ee"d7d8d � ee"d9d:d � d;d<� Z#d=d>� Z$G d?d@� d@e!�Z%G dAdB� dBe"�Z&G dCdD� dDe�Z'ee'd#dEd � G dFdG� dG�Z(G dHdI� dIe(ee�Z)G dJdK� dKe(e�Z*G dLdM� dMe(ee�Z+G dNdO� dOe �Z,G dPdQ� dQe�Z-dRdS� Z.G dTdU� dUee
�Z/ee/dVdWd � dXdY� Z0dZd[� Z1d\d]� Z2ddd^d_�Z3ded`da�Z4dedbdc�Z5dS )f� N)�EMPTY_NAMESPACE�EMPTY_PREFIX�XMLNS_NAMESPACE�domreg)�*)�DOMImplementationLS�
DocumentLSc @ s� e Zd ZdZdZdZdZdZeZ dd� Z
d2dd�Z d3dd �Zd
d� Z
dd
� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd$d%� Zd&d'� Zd(d)� Zd*d+� Zd,d-� Zd.d/� Zd0d1� Z dS )4�NodeNc C � dS )NT� ��selfr r �6/opt/alt/python310/lib64/python3.10/xml/dom/minidom.py�__bool__+ � z
Node.__bool__c C s | � dd||�S �N� )�toprettyxml)r
�encoding�
standaloner r r �toxml. � z
Node.toxml� �
c C sv |d u r t �� }nt jt �� |ddd�}| jtjkr%| �|d||||� n| �|d||� |d u r5|�� S |� � �� S )N�xmlcharrefreplacer )r �errors�newliner )
�io�StringIO�
TextIOWrapper�BytesIO�nodeTyper �
DOCUMENT_NODE�writexml�getvalue�detach)r
�indent�newlr r �writerr r r r 1 s
�zNode.toprettyxmlc C �
t | j�S �N)�bool�
childNodesr r r r �
hasChildNodesD �
zNode.hasChildNodesc C � | j S r* �r, r r r r �_get_childNodesG � zNode._get_childNodesc C � | j r| j d S d S �Nr r0 r r r r �_get_firstChildJ �
�zNode._get_firstChildc C r3 �N���r0 r r r r �_get_lastChildN r6 zNode._get_lastChildc C s |j | jkrt|j�D ]}| �||� q|S |j | jvr*tj�dt |�t | �f ��|j
d ur5|j
�|� |d u r@| �|� |S z| j�
|�}W n tyT tj�� �w |j tv r^t| � | j�||� ||_||_|r{| j|d }||_||_nd |_| |_
|S )N�%s cannot be child of %s� )r! �DOCUMENT_FRAGMENT_NODE�tupler, �insertBefore�_child_node_types�xml�dom�HierarchyRequestErr�repr�
parentNode�removeChild�appendChild�index�
ValueError�NotFoundErr�_nodeTypes_with_children�_clear_id_cache�insert�nextSibling�previousSibling)r
�newChild�refChild�crG �noder r r r>