/snap/core22/2437/usr/lib/python3.10/xml/sax/__pycache__
Edit: /snap/core22/2437/usr/lib/python3.10/xml/sax/__pycache__/saxutils.cpython-310.pyc (12646B)
o
p̦i/ @ s d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z dd Z
i fdd Zi fd
dZi fdd
Z
dd ZG dd dejZG dd de jZdddZdS )znA library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
N )handler) xmlreaderc C s" | D ]
\}}| ||} q| S )z2Replace substrings of a string using a dictionary.)itemsreplace)sdkeyvalue r '/usr/lib/python3.10/xml/sax/saxutils.py__dict_replace s r
c C s6 | 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
dataentitiesr r r escape s
r c C s2 | dd} | dd} |rt| |} | ddS )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 r r r unescape" s
r c C sZ i |dddd}t | |} d| v r'd| v r!d| dd } | S d | } | S d| } | 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 r r r quoteattr0 s
r c s d u rdd l }|jS t tjr S t tjtjfr S t tjr6G fddd}| }dd |_ n!t
}dd |_ j|_z
j
|_
j|_W n tyV Y nw tj||ddd d
S )Nr c s e Zd Z jZ fddZdS )z _gettextwriter.
._wrapperc s
t |S N)getattrselfnameoutr r __getattr__Z
z,_gettextwriter.._wrapper.__getattr__N)__name__
__module____qualname__ __class__r' r r% r r _wrapperX s r- c S s d S r r r r r r ] z _gettextwriter..c S s dS )NTr r r r r r. b r/ xmlcharrefreplacer T)encodingerrorsnewline
write_through)sysstdout
isinstanceio
TextIOBasecodecsStreamWriterStreamReaderWriter RawIOBasecloseBufferedIOBasewritablewriteseekabletellAttributeError
TextIOWrapper)r&