HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python37/lib64/python3.7/site-packages/markupsafe/__pycache__/__init__.cpython-37.pyc
B

V�`�"�@sLddlZddlZddlZddlZejr@ddlZGdd�dej�Z	dZ
e�d�Ze
ejdd�dd	�ZGd
d�de
�ZGdd
�d
ej�Ze�dee�Zeejejejejgefed�dd�ZGdd�d�Zy4ddlmZddlmZddlmZddlmZWnFe k
�rFddl!mZddl!mZddl!mZddl!mZYnXdS)�Nc@seZdZed�dd�ZdS)�HasHTML)�returncCsdS)N�)�selfrr�F/opt/alt/python37/lib64/python3.7/site-packages/markupsafe/__init__.py�__html__
szHasHTML.__html__N)�__name__�
__module__�__qualname__�strrrrrrr	srz2.0.1z(<!--.*?-->|<[^>]*>)).�Markup)�namercs4tt|��t���dtjtjdd��fdd��}|S)Nr)r�args�kwargsrcs>tt|�t|�|j�}t||��|j�|��|f|�|��S)N)�_escape_argspec�list�	enumerate�escape�items�	__class__)rrr)�origrr�wrappedsz)_simple_escaping_wrapper.<locals>.wrapped)�getattrr�	functools�wraps�t�Any)r
rr)rr�_simple_escaping_wrappers
rcseZdZdZdZd;ejejeedd��fdd�
Z	dd	�d
d�Z
ejedfdd
��fdd�Zejedfdd
�dd�Z
edd��fdd�ZeZejdd��fdd�Zed	��fdd�Zejejedfdd��fdd�Zejje_d<ejeeejdd��fdd �
Zejje_d=ejeeejdd��fd!d"�
Zejje_d>eejdd$��fd%d&�
Zejje_ed	�d'd(�Zed	�d)d*�Zeejdd+�d,d-��Zxd.D]Zee�e �e<�q�W[eej!d/d0��fd1d2�Z"eej!d/d0��fd3d4�Z#ejejdd5�d6d7�Z$edd8�d9d:�Z%�Z&S)?ra�A string that is ready to be safely inserted into an HTML or XML
    document, either because it was escaped or because it was marked
    safe.

    Passing an object to the constructor converts it to text and wraps
    it to mark it safe without escaping. To escape the text, use the
    :meth:`escape` class method instead.

    >>> Markup("Hello, <em>World</em>!")
    Markup('Hello, <em>World</em>!')
    >>> Markup(42)
    Markup('42')
    >>> Markup.escape("Hello, <em>World</em>!")
    Markup('Hello &lt;em&gt;World&lt;/em&gt;!')

    This implements the ``__html__()`` interface that some frameworks
    use. Passing an object that implements ``__html__()`` will wrap the
    output of that method, marking it safe.

    >>> class Foo:
    ...     def __html__(self):
    ...         return '<a href="/foo">foo</a>'
    ...
    >>> Markup(Foo())
    Markup('<a href="/foo">foo</a>')

    This is a subclass of :class:`str`. It has the same methods, but
    escapes their arguments and returns a ``Markup`` instance.

    >>> Markup("<em>%s</em>") % ("foo & bar",)
    Markup('<em>foo &amp; bar</em>')
    >>> Markup("<em>Hello</em> ") + "<foo>"
    Markup('<em>Hello</em> &lt;foo&gt;')
    r�N�strict)�base�encoding�errorsrcs:t|d�r|��}|dkr(t��||�St��||||�S)Nr)�hasattrr�super�__new__)�clsr r!r")rrrr%Es

zMarkup.__new__)rcCs|S)Nr)rrrrrPszMarkup.__html__r)�otherrcs0t|t�st|d�r,|�t��|�|���StS)Nr)�
isinstancerr#rr$�__add__r�NotImplemented)rr')rrrr)SszMarkup.__add__cCs(t|t�st|d�r$|�|��|�StS)Nr)r(rr#rr)r*)rr'rrr�__radd__YszMarkup.__radd__)�numrcs t|t�r|�t��|��StS)N)r(�intrr$�__mul__r*)rr,)rrrr._s
zMarkup.__mul__)�argrcs@t|t�r"t�fdd�|D��}nt|�j�}��t��|��S)Nc3s|]}t|�j�VqdS)N)�_MarkupEscapeHelperr)�.0�x)rrr�	<genexpr>isz!Markup.__mod__.<locals>.<genexpr>)r(�tupler0rrr$�__mod__)rr/)r)rrr5gs
zMarkup.__mod__cs|jj�dt����d�S)N�(�))rrr$�__repr__)r)rrrr8oszMarkup.__repr__)�seqrcs|�t��t|j|���S)N)rr$�join�mapr)rr9)rrrr:rszMarkup.join���)�sep�maxsplitrcs�fdd�t��||�D�S)Ncsg|]}��|��qSr)r)r1�v)rrr�
<listcomp>zsz Markup.split.<locals>.<listcomp>)r$�split)rr=r>)r)rrrAwszMarkup.splitcs�fdd�t��||�D�S)Ncsg|]}��|��qSr)r)r1r?)rrrr@�sz!Markup.rsplit.<locals>.<listcomp>)r$�rsplit)rr=r>)r)rrrB~sz
Markup.rsplitF)�keependsrcs�fdd�t��|�D�S)Ncsg|]}��|��qSr)r)r1r?)rrrr@�sz%Markup.splitlines.<locals>.<listcomp>)r$�
splitlines)rrC)r)rrrD�szMarkup.splitlinescCsddlm}|t|��S)u�Convert escaped markup back into a text string. This replaces
        HTML entities with the characters they represent.

        >>> Markup("Main &raquo; <em>About</em>").unescape()
        'Main » <em>About</em>'
        r)�unescape)ZhtmlrEr)rrErrrrE�szMarkup.unescapecCs"d�t�d|����}t|���S)u�:meth:`unescape` the markup, remove tags, and normalize
        whitespace to single spaces.

        >>> Markup("Main &raquo;	<em>About</em>").striptags()
        'Main » About'
        � r)r:�
_striptags_re�subrArrE)r�strippedrrr�	striptags�szMarkup.striptags)�srcCst|�}|j|k	r||�S|S)ztEscape a string. Calls :func:`escape` and ensures that for
        subclasses the correct type is returned.
        )rr)r&rK�rvrrrr�s
z
Markup.escape)�__getitem__�
capitalize�title�lower�upper�replace�ljust�rjust�lstrip�rstrip�center�strip�	translate�
expandtabs�swapcase�zfill)rrr)r=rcs4t��|�|��\}}}|j}||�||�||�fS)N)r$�	partitionrr)rr=�lrK�rr&)rrrr]�szMarkup.partitioncs4t��|�|��\}}}|j}||�||�||�fS)N)r$�
rpartitionrr)rr=r^rKr_r&)rrrr`�szMarkup.rpartition)rrrcOst|j�}|�|�|||��S)N)�EscapeFormatterrrZvformat)rrrZ	formatterrrr�format�s
z
Markup.format)�format_specrcCs|rtd��|S)Nz,Unsupported format specification for Markup.)�
ValueError)rrcrrr�__html_format__�szMarkup.__html_format__)rNr)Nr<)Nr<)F)'rr	r
�__doc__�	__slots__rrZOptionalrr%rZUnionr)r+r-r.�__rmul__r5r8�Iterabler:ZListrArB�boolrDrErJ�classmethodr�methodr�localsZTupler]r`rbre�
__classcell__rr)rrrsB"	$




rcsJeZdZdZejejgefdd��fdd�Zeje	e	d�dd�Z
�ZS)	ra)rN)rrcs||_t���dS)N)rr$�__init__)rr)rrrro�szEscapeFormatter.__init__)�valuercrcCsjt|d�r|�|�}nFt|d�rH|r>td|�dt|��d���|��}ntj�||t|��}t|�	|��S)NrerzFormat specifier z given, but z{ does not define __html_format__. A class that defines __html__ must define __html_format__ to work with format specifiers.)
r#rerd�typer�string�	Formatter�format_fieldrr)rrprcrLrrrrt�s


zEscapeFormatter.format_field)rr	r
rgr�Callablerrrorrtrnrr)rrra�s"ra�_ListOrDict)�obj�iterablerrcCs6x0|D](\}}t|t�s"t|d�r||�||<qW|S)z,Helper for various string-wrapped functions.r)r(rr#)rwrxr�keyrprrrr�src@s�eZdZdZdZejejejgefdd�dd�Z	ejdd�dd	�Z
ed
�dd�Zed
�d
d�Z
ed
�dd�Zed
�dd�ZdS)r0z"Helper for :meth:`Markup.__mod__`.)rwrN)rwrrcCs||_||_dS)N)rwr)rrwrrrrrosz_MarkupEscapeHelper.__init__)�itemrcCst|j||j�S)N)r0rwr)rrzrrrrMsz_MarkupEscapeHelper.__getitem__)rcCst|�|j��S)N)rrrw)rrrr�__str__	sz_MarkupEscapeHelper.__str__cCst|�t|j���S)N)rr�reprrw)rrrrr8sz_MarkupEscapeHelper.__repr__cCs
t|j�S)N)r-rw)rrrr�__int__sz_MarkupEscapeHelper.__int__cCs
t|j�S)N)�floatrw)rrrr�	__float__sz_MarkupEscapeHelper.__float__)rr	r
rfrgrrrurrorMrr{r8r-r}r~rrrrrr0�s"r0�)r)�
escape_silent)�soft_str)�soft_unicode)"r�rerr�typingrZ
TYPE_CHECKINGZtyping_extensionsZteZProtocolr�__version__�compilerGrrurrrsraZTypeVarr�dictrvrirrr0Z	_speedupsrr�r�r��ImportErrorZ_nativerrrr�<module>s4
8