/opt/alt/python-internal/lib64/python3.11/xml/sax/__pycache__
Edit: /opt/alt/python-internal/lib64/python3.11/xml/sax/__pycache__/saxutils.cpython-311.pyc (21597B)
!A?h/ d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z d Z
i fdZi fdZi fd Z
d
Z G d dej Z G d
de j ZddZdS )znA library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
N )handler) xmlreaderc f | D ]\ }}| || } | S )z2Replace substrings of a string using a dictionary.)itemsreplace)sdkeyvalues =/opt/alt/python-internal/lib64/python3.11/xml/sax/saxutils.py__dict_replacer s7 ggii " "
U
IIc5!!H c | dd } | dd } | dd } |rt | | } | S )zEscape &, <, and > in a string of data.
You can escape other strings of data by passing a dictionary as
the optional entities parameter. The keys and values must all be
strings; each key will be replaced with its corresponding value.
&&>><<r r dataentitiess r
escaper sY <<W%%D<<V$$D<<V$$D .dH--Kr c | dd } | dd } |rt | | } | dd S )a
Unescape &, <, and > in a string of data.
You can unescape other strings of data by passing a dictionary as
the optional entities parameter. The keys and values must all be
strings; each key will be replaced with its corresponding value.
r r r r r r r r s r
unescaper " sU <<$$D<<$$D .dH--<<%%%r c i |dddd}t | | } d| v r$d| v rd| dd z } nd | z } nd| z } | S )
a Escape and quote an attribute value.
Escape &, <, and > in a string of data, then quote it for use as
an attribute value. The " character will be escaped as well, if
necessary.
You can escape other strings of data by passing a dictionary as
the optional entities parameter. The keys and values must all be
strings; each key will be replaced with its corresponding value.
z
z
z )
"'z"%s"z"z'%s')r r r s r
quoteattrr$ 0 sr G(F'vFFFH$!!D
d{{$;;DLLh777DDD=DD}Kr c dd l }|j S t t j r S t t
j t
j f r S t t j r" G fdd } | }d |_ nQt j
}d |_ j |_ j
|_
j |_ n# t $ r Y nw xY wt j ||ddd S )
Nr c ( e Zd Z j Z fdZdS ) _gettextwriter.
._wrapperc $ t | S N)getattr)selfnameouts r
__getattr__z,_gettextwriter.._wrapper.__getattr__Z s sD)))r N)__name__
__module____qualname__ __class__r. )r- s r
_wrapperr' X s5
I
*
*
*
*
*
*
*r r3 c d S r) r5 r r
z _gettextwriter..] s t r c dS )NTr5 r5 r r
r6 z _gettextwriter..b s $ r xmlcharrefreplacer T)encodingerrorsnewline
write_through)sysstdout
isinstanceio
TextIOBasecodecsStreamWriterStreamReaderWriter RawIOBasecloseBufferedIOBasewritablewriteseekabletellAttributeError
TextIOWrapper)r- r9 r= r3 buffers ` r
_gettextwriterrO G s8
{
z#r}%%
#+V-FGHH
#r|$$ * * * * * * * * * * #| "$$&,y "lFO(FKK D
FX#6$(*.0 0 0 0s 7C
CCc f e Zd ZddZd ZddZd Zd Zd Zd
Z d Z
d Zd
Zd Z
d Zd Zd ZdS )XMLGeneratorN
iso-8859-1Fc t j | t || }|j | _ |j | _ i g| _ | j d | _ g | _
|| _ || _ d| _
d S )NF)r ContentHandler__init__rO rI _writeflush_flush_ns_contexts_current_context_undeclared_ns_maps _encoding_short_empty_elements_pending_start_element)r+ r- r9 short_empty_elementss r
rV zXMLGenerator.__init__r sy ''---S(++iiD $ 1" 5#% !%9"&+###r c |d r:d|d k rd|d z S | j |d }|r|dz |d z S |d S )z7Builds a qualified name from a (ns_url, localname) pairr z$http://www.w3.org/XML/1998/namespacezxml:r :)r[ )r+ r, prefixs r
_qnamezXMLGenerator._qname~ sc 7 .
6a@@Q''*473F
.|d1g--Awr c P | j r| d d| _ d S d S )Nr Fr_ rW )r+
endElements r
_finish_pending_start_elementz*XMLGenerator._finish_pending_start_element s7 &