%PDF- %PDF-
Mini Shell

Mini Shell

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

�

���ei6��H�UdZddlmZddlZddlZddlZddlmZmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZerddlmZddlmcmZed�Z	gd	�Zd
ed<	dZ	d
Z	edzZ	edzezZ	ej>edz�Z 	edzezZ!	edzezZ"	ej>e"dz�Z#	edzezZ$	dZ%ed��d��Z&d(d)d�Z'd*d+d�Z(d,d�Z)d(d-d�Z*d.d�Z+Gd�de,�Z-Gd�d�Z.erGd �d!e�Z/Gd"�d#�Z0Gd$�d%e�Z1Gd&�d'e
e�Z2y)/zv
This module contains various contacts, classes and functions which get referenced and used
throughout the code base.
�)�annotationsN)�wraps�	lru_cache)�count)�
TYPE_CHECKING�Generic�Iterator�
NamedTuple�TypeVar�	TypedDict�overload)�Markdown�_T):�address�article�aside�
blockquote�details�div�dl�fieldset�
figcaption�figure�footer�form�h1�h2�h3�h4�h5�h6�header�hgroup�hr�main�menu�nav�ol�p�pre�section�table�ul�canvas�colgroup�dd�body�dt�group�html�iframe�li�legend�math�map�noscript�output�object�option�progress�script�style�summary�tbody�td�textarea�tfoot�th�thead�tr�videoz	list[str]�BLOCK_LEVEL_ELEMENTS��zklzzwxh:z%sz([0-9]+)�ampz
wzxhzdk:%sz
hzzhzkh:%s))u֐u߿)uⴰu⵿)�maxsizec�b�tjdk\rddlm}nddl}|jd��S)z= Return all entry_points in the `markdown.extensions` group. )��
r��metadataNzmarkdown.extensions)r3)�sys�version_info�	importlibrS�importlib_metadata�entry_pointsrRs �//usr/lib/python3/dist-packages/markdown/util.py�get_installed_extensionsrZfs-�����7�"�&�-�� � �'<� �=�=�c������fd�}|S)z�
    Raise a [`DeprecationWarning`][] when wrapped function/method is called.

    Usage:

    ```python
    @deprecated("This method will be removed in version X; use Y instead.")
    def some_method():
        pass
    ```
    c�4���t�����fd��}|S)Nc�l��tjd�j�d���t����|i|��S)N�'z' is deprecated. )�category�
stacklevel)�warnings�warn�__name__�DeprecationWarning)�args�kwargs�func�messageras  ���rY�deprecated_funcz4deprecated.<locals>.wrapper.<locals>.deprecated_func~s<����M�M��D�M�M�?�"3�G�9�=�+�%�
�
��(��(�(r[)r)rhrjriras` ��rY�wrapperzdeprecated.<locals>.wrapper}s!���	�t��	)�
�	)��r[�)rirarks`` rY�
deprecatedrmqs���	��Nr[c���t|t�s|r|�|St|�S|r|j�dk(ry|j�dvry|j�dvry|rt	d|z��y)aParses a string representing a boolean value. If parsing was successful,
       returns `True` or `False`. If `preserve_none=True`, returns `True`, `False`,
       or `None`. If parsing was not successful, raises `ValueError`, or, if
       `fail_on_errors=False`, returns `None`.N�none)�true�yes�y�on�1T)�false�no�n�off�0roFzCannot parse bool value: %r)�
isinstance�str�bool�lower�
ValueError)�value�fail_on_errors�
preserve_nones   rY�parseBoolValuer��st��
�e�S�!��U�]��L��E�{��	�5�;�;�=�F�2��	����9�	9��	����B�	B��	��6��>�?�?�
r[c��d|vr|jdd�}d|vr|jdd�}d|vr|jdd�}|S)zHTML escape a string of code.�&z&amp;�<z&lt;�>z&gt;)�replace)�texts rY�code_escaper��sL��
�d�{��|�|�C��)��
�d�{��|�|�C��(��
�d�{��|�|�C��(���Kr[c�r�tj|�}t|�D]}|j}|r�|cSy)z+Get current stack depth, performantly.
    N)rT�	_getframer�f_back)�size�frames  rY�_get_stack_depthr��s6��
�M�M�$��E��d����������K�r[c�F�tj�t�z
dkS)zBReturn true if current stack depth is within 100 of maximum limit.�d)rT�getrecursionlimitr�rlr[rY�nearing_recursion_limitr��s��� � �"�%5�%7�7�#�=�=r[c��eZdZdZy)�AtomicStringz/A string which should not be further processed.N)rd�
__module__�__qualname__�__doc__rlr[rYr�r��s��9�r[r�c��eZdZdZddd�Zy)�	Processorz� The base class for all processors.

    Attributes:
        Processor.md: The `Markdown` instance passed in an initialization.

    Arguments:
        md: The `Markdown` instance this processor is a part of.

    Nc��||_y�N)�md)�selfr�s  rY�__init__zProcessor.__init__�s	����r[r�)r�zMarkdown | None)rdr�r�r�r�rlr[rYr�r��s���r[r�c�6�eZdZUded<ded<ded<ded<y)	�TagDatar{�tag�dict[str, str]�attrs�int�
left_index�right_indexN�rdr�r��__annotations__rlr[rYr�r��s��
�������r[r�c�6�eZdZdZd�Zdd�Zd	d�Zd
d�Zdd�Zy)�	HtmlStashz{
    This class is used for stashing HTML objects that we extract
    in the beginning and replace with place-holders.
    c�<�d|_g|_d|_g|_y)z Create an `HtmlStash`. rN)�html_counter�
rawHtmlBlocks�tag_counter�tag_data�r�s rYr�zHtmlStash.__init__�s!�����8:������')��
r[c��|jj|�|j|j�}|xjdz
c_|S)a

        Saves an HTML segment for later reinsertion.  Returns a
        placeholder string that needs to be inserted into the
        document.

        Keyword arguments:
            html: An html segment.

        Returns:
            A placeholder string.

        �)r��append�get_placeholderr�)r�r4�placeholders   rY�storezHtmlStash.store�sE��	
���!�!�$�'��*�*�4�+<�+<�=�����Q����r[c� �d|_g|_y)z Clear the stash. rN)r�r�r�s rY�resetzHtmlStash.reset�s�������r[c��t|zSr�)�HTML_PLACEHOLDER�r��keys  rYr�zHtmlStash.get_placeholder�s
���#�%�%r[c��|jj||||d��tt|j�z}|xjdz
c_|S)z(Store tag data and return a placeholder.)r�r�r�r�r�)r�r��TAG_PLACEHOLDERr{r�)r�r�r�r�r�r�s      rY�	store_tagzHtmlStash.store_tag�sQ���
�
���S�5�,6�-8�:�	;�&��D�,<�,<�(=�=�����A����r[N)r4zstr | etree.Element�returnr{�r��None)r�r�r�r{)
r�r{r�r�r�r�r�r�r�r{)	rdr�r�r�r�r�r�r�r�rlr[rYr�r��s ���
*��$ �
&�r[r�c�"�eZdZUded<ded<y)�
_PriorityItemr{�name�float�priorityNr�rlr[rYr�r�s��

�I��Or[r�c��eZdZdZd�Zdd�Zdd�Zedd��Zedd��Zdd�Zdd�Z	d	�Z
dd
�Zdd�Zddd�Z
dd
�Zy)�Registrya�
    A priority sorted registry.

    A `Registry` instance provides two public methods to alter the data of the
    registry: `register` and `deregister`. Use `register` to add items and
    `deregister` to remove items. See each method for specifics.

    When registering an item, a "name" and a "priority" must be provided. All
    items are automatically sorted by "priority" from highest to lowest. The
    "name" is used to remove ("deregister") and get items.

    A `Registry` instance it like a list (which maintains order) when reading
    data. You may iterate over the items, get an item and get a count (length)
    of all items. You may also check that the registry contains an item.

    When getting an item you may use either the index of the item or the
    string-based "name". For example:

        registry = Registry()
        registry.register(SomeItem(), 'itemname', 20)
        # Get the item by index
        item = registry[0]
        # Get the item by name
        item = registry['itemname']

    When checking that the registry contains an item, you may use either the
    string-based "name", or a reference to the actual item. For example:

        someitem = SomeItem()
        registry.register(someitem, 'itemname', 20)
        # Contains the name
        assert 'itemname' in registry
        # Contains the item instance
        assert someitem in registry

    The method `get_index_for_name` is also available to obtain the index of
    an item using that item's assigned "name".
    c�.�i|_g|_d|_y)NF)�_data�	_priority�
_is_sortedr�s rYr�zRegistry.__init__8s��$&��
�.0�����r[c��t|t�r||jj�vS||jj	�vSr�)rzr{r��keys�values)r��items  rY�__contains__zRegistry.__contains__=s:���d�C� ��4�:�:�?�?�,�,�,��t�z�z�(�(�*�*�*r[c��|j�t|jD��cgc]\}}|j|��c}}�Scc}}wr�)�_sort�iterr�r�)r��kr)s   rY�__iter__zRegistry.__iter__Ds4���
�
���t�~�~�>�t�q�!�T�Z�Z��]�>�?�?��>s�A
c��yr�rlr�s  rY�__getitem__zRegistry.__getitem__H���r[c��yr�rlr�s  rYr�zRegistry.__getitem__Lr�r[c�R�|j�t|t�rCt�}|j|D]%\}}|j|j|||��'|St|t�r&|j|j|jS|j|Sr�)	r�rz�slicer�r��registerr�r�r�)r�r��datar�r)s     rYr�zRegistry.__getitem__Ps����
�
���c�5�!�!)��D����s�+�
3���1��
�
�d�j�j��m�Q��2�
3��K��c�3���:�:�d�n�n�S�1�6�6�7�7��z�z�#��r[c�,�t|j�Sr�)�lenr�r�s rY�__len__zRegistry.__len__[s���4�>�>�"�"r[c�`�dj|jjt|��S)Nz<{}({})>)�format�	__class__rd�listr�s rY�__repr__zRegistry.__repr__^s#��� � ����!8�!8�$�t�*�E�Er[c���||vrV|j�|jj|jD�cgc]}|j|k(s�|��c}d�St	dj|���cc}w)z5
        Return the index of the given name.
        rzNo item named "{}" exists.)r�r��indexr�r~r�)r�r��xs   rY�get_index_for_namezRegistry.get_index_for_nameasj���4�<��J�J�L��>�>�'�'� �N�N�=�q�a�f�f��n��=�a�@��
��5�<�<�T�B�C�C��>s�A5�
A5c��||vr|j|�d|_||j|<|jj	t||��y)aW
        Add an item to the registry with the given name and priority.

        Arguments:
            item: The item being registered.
            name: A string used to reference the item.
            priority: An integer or float used to sort against all items.

        If an item is registered with a "name" which already exists, the
        existing item is replaced with the new item. Treat carefully as the
        old item is lost with no way to recover it. The new item will be
        sorted according to its priority and will **not** retain the position
        of the old item.
        FN)�
deregisterr�r�r�r�r�)r�r�r�r�s    rYr�zRegistry.registerlsE���4�<��O�O�D�!������
�
�4�������m�D�(�;�<r[c��	|j|�}|j|=|j|=y#t$r|r�YywxYw)z�
        Remove an item from the registry.

        Set `strict=False` to fail silently. Otherwise a [`ValueError`][] is raised for an unknown `name`.
        N)r�r�r�r~)r�r��strictr�s    rYr�zRegistry.deregister�sI��	��+�+�D�1�E����u�%��
�
�4� ���	����	�s�+.�=�=c�h�|js&|jjd�d��d|_yy)z�
        Sort the registry by priority from highest to lowest.

        This method is called internally and should never be explicitly called.
        c��|jSr�)r�)r�s rY�<lambda>z Registry._sort.<locals>.<lambda>�s
�����r[T)r��reverseN)r�r��sortr�s rYr�zRegistry._sort�s/������N�N���$>���M�"�D�O�r[N)r�zstr | _Tr�r|)r�zIterator[_T])r�z	str | intr�r)r�r�r�zRegistry[_T])r�zstr | int | slicer�z_T | Registry[_T])r�r�)r�r{r�r�)r�rr�r{r�r�r�r�)T)r�r{r�r|r�r�r�)rdr�r�r�r�r�r�r
r�r�r�r�r�r�r�rlr[rYr�r�se��%�N �
+�@���������	�#�F�	D�=�,�#r[r�)�)rir{rar�)TF)rz
str | Noner�r|r�r|r�zbool | None)r�r{r�r{)r�r�r�r�)r�r|)3r��
__future__r�rerTrb�	functoolsrr�	itertoolsr�typingrrr	r
rrr
�markdownr�xml.etree.ElementTree�etree�ElementTreerrJr��STX�ETX�INLINE_PLACEHOLDER_PREFIX�INLINE_PLACEHOLDER�compile�INLINE_PLACEHOLDER_RE�AMP_SUBSTITUTEr��HTML_PLACEHOLDER_REr��RTL_BIDI_RANGESrZrmr�r�r�r�r{r�r�r�r�r�r�rlr[rY�<module>r	sz��(�
#�	�
��&��]�]�]��!�)�)��T�]���#��i�����9���7��
�N��/�.��5��;��5�"��
�
�#5��#C�D��=��U��3���/���%��+��*� �b�j�j�!1�K�!?�@��;���$�s�*��&����4��>��>��2@�&��>�	�3�	�
����)��.�.�h�J��
H#�w�r�{�H#r[

Zerion Mini Shell 1.0