%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/markupsafe/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/markupsafe/__pycache__/__init__.cpython-312.pyc

�

^�e�*����ddlZddlZddlZddlZej
r+ddlZGd�dej�Z	ejd�ZdZdd�Z
Gd�d	e�ZGd
�dej �Zej$dee�Zd
edej,ej.dej0ej.gefdefd�ZGd�d�Z	ddlmZddlmZddlmZy#e$rddl mZddl mZddl mZYywxYw)�Nc��eZdZdefd�Zy)�HasHTML�returnc��y�N���selfs �5/usr/lib/python3/dist-packages/markupsafe/__init__.py�__html__zHasHTML.__html__
s���N)�__name__�
__module__�__qualname__�strrrr
rrr	s��	�c�	r
r�_Pz2.1.5rc�D��tj��d�fd��}|S)Nc����tt|�t|�|j�}t||j	�|j�|j�|g|��i|���Sr)�_escape_argspec�list�	enumerate�escape�items�	__class__)r
�args�kwargs�arg_list�funcs    �r�wrappedz)_simple_escaping_wrapper.<locals>.wrappedsQ���"�4��:�y������L�����������<��~�~�d�4�=�(�=�f�=�>�>r
)r
�Markuprz_P.argsrz	_P.kwargsrr )�	functools�wraps)rrs` r�_simple_escaping_wrapperr#s%����_�_�T��?��?�
�Nr
c	�
��eZdZdZdZ	d)dejdejededdf�fd�
Z	d*d	�Z
d
ejedfddf�fd�Zd
ejedfddfd
�Z
d+�fd�ZeZdejddf�fd�Zdef�fd�Zdej$ejedfddf�fd�Zej&je_	d,dejededej*df�fd�
Zej,je_	d,dejededej*df�fd�
Zej.je_	d-dedej*df�fd�
Zej2je_defd�Zdefd�Zedejddfd��Zeej>�Zeej@�Z eejB�Z!eejD�Z"eejF�Z#eejH�Z$eejJ�Z%eejL�Z&eejN�Z'eejP�Z(eejR�Z)eejT�Z*eejV�Z+eejX�Z,eejZ�Z-eej\�Z.eej^�Z/e0jbdk\r$eejd�Z2eejf�Z3dedejhdf�fd �Z5dedejhdf�fd!�Z6d"ejd#ejddfd$�Z7d%ejpeejfddfd&�Z9d'eddfd(�Z:�xZ;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�base�encoding�errorsr�te.Selfc���t|d�r|j�}|�t�|�
||�St�|�
||||�S�Nr)�hasattrr�super�__new__)�clsr%r&r'rs    �rr-zMarkup.__new__CsF����4��$��=�=�?�D����7�?�3��-�-��w��s�D�(�F�;�;r
c��|Srrr	s rrzMarkup.__html__Ns���r
�otherrc���t|t�st|d�r-|jt�|�|j
|���StSr*)�
isinstancerr+rr,�__add__r�NotImplemented)r
r0rs  �rr3zMarkup.__add__Qs=����e�S�!�W�U�J�%?��>�>�%�'�/�$�+�+�e�2D�"E�F�F��r
c��t|t�st|d�r |j|�j	|�St
Sr*)r2rr+rr3r4)r
r0s  r�__radd__zMarkup.__radd__Ws5���e�S�!�W�U�J�%?��;�;�u�%�-�-�d�3�3��r
c�l��t|t�r|jt�|�|��St
Sr)r2�intrr,�__mul__r4)r
�numrs  �rr9zMarkup.__mul__]s+����c�3���>�>�%�'�/�#�"6�7�7��r
�argc�2���t|t�rt�fd�|D��}nStt|�d�r't|t�st|�j�}nt|�j�f}�jt���%|��S)Nc3�J�K�|]}t|�j����y�wr)�_MarkupEscapeHelperr)�.0�xr
s  �r�	<genexpr>z!Markup.__mod__.<locals>.<genexpr>hs�����I��+�A�t�{�{�;�I�s� #�__getitem__)
r2�tupler+�typerr>rrr,�__mod__)r
r;rs` �rrEzMarkup.__mod__esq����c�5�!��I�S�I�I�C�
�T�#�Y�
�
.�z�#�s�7K�%�c�4�;�;�7�C�'�s�D�K�K�8�:�C��~�~�e�g�o�c�2�3�3r
c�T��|jj�dt�|�
��d�S)N�(�))rrr,�__repr__)r
rs �rrIzMarkup.__repr__rs*����.�.�)�)�*�!�E�G�,<�,>�+?�q�A�Ar
�seqc�h��|jt�|�	t|j|���Sr)rr,�join�mapr)r
rJrs  �rrLzMarkup.joinus&����~�~�e�g�l�3�t�{�{�C�+@�A�B�Br
�sep�maxsplitc�h��t�|�||�D�cgc]}|j|���c}Scc}wr)r,�splitr�r
rNrO�vrs    �rrQzMarkup.splitzs-���,1�7�=��h�+G�H�a����q�!�H�H��H��/c�h��t�|�||�D�cgc]}|j|���c}Scc}wr)r,�rsplitrrRs    �rrVz
Markup.rsplit�s-���,1�7�>�#�x�+H�I�a����q�!�I�I��IrT�keependsc�f��t�|�|�D�cgc]}|j|���c}Scc}wr)r,�
splitlinesr)r
rWrSrs   �rrYzMarkup.splitlines�s,���,1�7�+=�h�+G�H�a����q�!�H�H��Hs�.c�0�ddlm}|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)�htmlr[r)r
r[s  rr[zMarkup.unescape�s��	"���D�	�"�"r
c��t|�}	|jd�}|dk(rn(|jd|�}|dk(rn|d|�||dzd��}�?	|jd�}|dk(rn(|jd|�}|dk(rn|d|�||dzd��}�?d	j|j��}|j	|�j�S)
u�:meth:`unescape` the markup, remove tags, and normalize
        whitespace to single spaces.

        >>> Markup("Main &raquo;	<em>About</em>").striptags()
        'Main » About'
        z<!--���z-->N��<�>�� )r�findrLrQrr[)r
�value�start�ends    r�	striptagszMarkup.striptags�s����D�	��
��J�J�v�&�E���{���*�*�U�E�*�C��b�y���V�e�}�o�e�C�!�G�H�o�%6�7�E�� ��J�J�s�O�E���{���*�*�S�%�(�C��b�y���V�e�}�o�e�C�!�G�H�o�%6�7�E���������'���~�~�e�$�-�-�/�/r
�sc�H�t|�}|j|ur||�S|S)ztEscape a string. Calls :func:`escape` and ensures that for
        subclasses the correct type is returned.
        )rr)r.ri�rvs   rrz
Markup.escape�s'��
�A�Y��
�<�<�s�"��r�7�N��	r
)r_�	)r(r(r(c���t�|�|j|��\}}}|j}||�||�||�fSr)r,�	partitionrr�r
rN�lri�rr.rs      �rrnzMarkup.partition�sC����'�#�D�K�K��$4�5���1�a��n�n���1�v�s�1�v�s�1�v�%�%r
c���t�|�|j|��\}}}|j}||�||�||�fSr)r,�
rpartitionrrros      �rrszMarkup.rpartition�sC����'�$�T�[�[��%5�6���1�a��n�n���1�v�s�1�v�s�1�v�%�%r
rrc�p�t|j�}|j|j|||��Sr��EscapeFormatterrr�vformat)r
rr�	formatters    r�formatz
Markup.format�s.��#�D�K�K�0�	��~�~�i�/�/��d�F�C�D�Dr
rMc�p�t|j�}|j|j|d|��S)Nrru)r
rMrxs   r�
format_mapzMarkup.format_map�s0��$�D�K�K�0�	��~�~�i�/�/��b�#�>�?�?r
�format_specc� �|rtd��|S)Nz,Unsupported format specification for Markup.)�
ValueError)r
r|s  r�__html_format__zMarkup.__html_format__�s����K�L�L��r
)�N�strict)rr()r:zte.SupportsIndexrr()Nr^)F)<rrr�__doc__�	__slots__�t�Any�Optionalrr-r�Unionr3r6r9�__rmul__rErI�IterablerLr8�ListrQrV�boolrYr[rh�classmethodrr#rB�
capitalize�title�lower�upper�replace�ljust�rjust�lstrip�rstrip�center�strip�	translate�
expandtabs�swapcase�zfill�casefold�sys�version_info�removeprefix�removesuffix�Tuplernrsry�Mappingr{r�
__classcell__�rs@rr r s����!�F�I�PX�	<��5�5�	<�)*���C��	<�IL�	<�	�	<���Q�W�W�S�)�^�4�����a�g�g�c�9�n�5��)����H�4�1�5�5�4�Y�4�B�#�B�C��
�
�1�7�7�3�	�>�#:�;�C�	�C��8�8�#�#�D�L�<>�I��:�:�c�?�I�58�I�	
���	�	�I�
�I�I�%�%�E�M�<>�J��:�:�c�?�J�58�J�	
���	�	�J�
�Z�Z�'�'�F�N� %�I��I�	
���	�	�I�
���/�/�J��	#�#�	#�+0�3�+0�Z�	�q�u�u�	��	��	�+�3�?�?�;�K�)�#�.�.�9�J�$�S�Y�Y�/�E�$�S�Y�Y�/�E�$�S�Y�Y�/�E�&�s�{�{�3�G�$�S�Y�Y�/�E�$�S�Y�Y�/�E�
%�c�j�j�
1�F�
%�c�j�j�
1�F�
%�c�j�j�
1�F�$�S�Y�Y�/�E�(����7�I�)�#�.�.�9�J�'����5�H�$�S�Y�Y�/�E�'����5�H�
���6�!�/��0@�0@�A��/��0@�0@�A��&�S�&�Q�W�W�-L�%M�&�
&�c�&�a�g�g�.M�&N�&�
E�A�E�E�E�Q�U�U�E�y�E�@��9�9�S�!�%�%�Z�(�@�	�@��3��9�r
r c���eZdZdZdej
ejgefddf�fd�Zdejde	de	fd�Z
�xZS)	rv�rrrNc�0��||_t�|�	�yr)rr,�__init__)r
rrs  �rr�zEscapeFormatter.__init__s������
���r
rer|c�:�t|d�r|j|�}ndt|d�r.|rtd|�dt|��d���|j	�}n*t
jj||t|��}t|j|��S)NrrzFormat 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+rr~rDr�string�	Formatter�format_fieldrr)r
rer|rks    rr�zEscapeFormatter.format_fields����5�+�,��&�&�{�3�B�
�U�J�
'�� �'��}�L��e��
�NG�G���
���!�B��!�!�.�.�t�U�C��<L�M�B��4�;�;�r�?�#�#r
)rrrr�r��Callabler�r r�rr�r�r�s@rrvrvsL����I��q�z�z�1�5�5�'�6�/�:��t��$�!�%�%�$�c�$�c�$r
rv�_ListOrDict�obj�iterablerc�j�|D]-\}}t|t�s
t|d�s�#||�||<�/|S)z,Helper for various string-wrapped functions.r)r2rr+)r�r�r�keyres     rrr s>���%�
��U��e�S�!�W�U�J�%?��e�}�C��H�%��Jr
c���eZdZdZdZdejdejejgefddfd�Z	dejdd	fd
�Z
defd�Zdefd�Z
defd
�Zdefd�Zy)r>z"Helper for :meth:`Markup.__mod__`.�r�rr�rrNc� �||_||_yrr�)r
r�rs   rr�z_MarkupEscapeHelper.__init__0s�������r
�itemr(c�T�|j|j||j�Sr)rr�r)r
r�s  rrBz_MarkupEscapeHelper.__getitem__4s���~�~�d�h�h�t�n�d�k�k�:�:r
c�J�t|j|j��Sr)rrr�r	s r�__str__z_MarkupEscapeHelper.__str__7s���4�;�;�t�x�x�(�)�)r
c�\�t|jt|j���Sr)rr�reprr�r	s rrIz_MarkupEscapeHelper.__repr__:s���4�;�;�t�D�H�H�~�.�/�/r
c�,�t|j�Sr)r8r�r	s r�__int__z_MarkupEscapeHelper.__int__=s���4�8�8�}�r
c�,�t|j�Sr)�floatr�r	s r�	__float__z_MarkupEscapeHelper.__float__@s���T�X�X��r
)rrrr�r�r�r�r�r r�rBrr�rIr8r�r�r�rr
rr>r>+s���,�!�I��A�E�E��1�:�:�q�u�u�g�v�o�+F��4��;����;�)�;�*��*�0�#�0�����5�r
r>rbr�)�
escape_silent)�soft_str)rzt.Callable[_P, str]rzt.Callable[_P, Markup])!r!r�r��typingr��
TYPE_CHECKING�typing_extensions�te�Protocolr�	ParamSpecr�__version__r#rr r�rv�TypeVarr�dictr�r�r�r�rr>�	_speedupsrr�r��ImportError�_nativerr
r�<module>r�s����
�
���?�?�"��"�+�+��
����d�	�B����d�S�d�N$�f�&�&�$�2�a�i�i�
�t�T�2���	�� !�
�
�1�5�5� 1��;<�:�:�q�u�u�g�v�o�;V������4.�+�9�/���.�)�7�-�.�s�
C�C7�6C7

Zerion Mini Shell 1.0