Uname:Linux developmentwebsite.ca 4.18.0-553.168.1.el8_10.x86_64 #1 SMP Thu Sep 24 18:05:46 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 173.249.148.11  /  Your IP : 216.73.216.179
Web Server : Apache/2.4.68 (AlmaLinux)
System : Linux developmentwebsite.ca 4.18.0-553.168.1.el8_10.x86_64 #1 SMP Thu Sep 24 18:05:46 UTC 2026 x86_64
User : devinter ( 1006)
PHP Version : 8.3.35
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /snap/certbot/current/lib64/python3.12/site-packages/packaging/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /snap/certbot/current/lib64/python3.12/site-packages/packaging/__pycache__/utils.cpython-312.pyc
�

��j�/��.�ddlmZddlZddlmZmZmZddlmZm	Z	m
Z
mZddlm
Z
mZmZgd�Zdd�Zeed	eeeffZ	ed
e�Z	Gd�de�ZGd
�de�ZGd�de�Zej6dej8ej:z�Zej6dej:�Zej6dej:�Z ej6dejB�Z"dd�d d�Z#d!d�Z$dd�					d"d�Z%dd�					d#d�Z&d$d�Z'y)%�)�annotationsN)�NewType�Union�cast�)�
InvalidTag�Tag�UnsortedTagsError�	parse_tag)�InvalidVersion�Version�_TrimmedRelease)
�BuildTag�InvalidName�InvalidSdistFilename�InvalidWheelFilename�NormalizedName�canonicalize_name�canonicalize_version�is_normalized_name�parse_sdist_filename�parse_wheel_filenamec��tS)N)�__all__���K/root/parts/certbot/install/lib/python3.12/site-packages/packaging/utils.py�__dir__rs���Nrrrc��eZdZdZy)rzs
    An invalid distribution name; users should refer to the packaging user guide.

    .. versionadded:: 23.2
    N��__name__�
__module__�__qualname__�__doc__rrrrr.���rrc��eZdZdZy)rzi
    An invalid wheel filename was found, users should refer to PEP 427.

    .. versionadded:: 20.9
    Nr rrrrr6r%rrc��eZdZdZy)rzz
    An invalid sdist filename was found, users should refer to the packaging user guide.

    .. versionadded:: 20.9
    Nr rrrrr>r%rrz%[a-z0-9]|[a-z0-9][a-z0-9._-]*[a-z0-9]z[a-z0-9]+(?:-[a-z0-9]+)*z	(\d+)(.*)z
^[\w._]+\ZF)�validatec��|r#tj|�std|����|j�j	dd�j	dd�}d|vr|j	dd�}d|vr�td|�S)a#
    This function takes a valid Python package or extra name, and returns the
    normalized form of it.

    The return type is typed as :class:`NormalizedName`. This allows type
    checkers to help require that a string has passed through this function
    before use.

    If **validate** is true, then the function will check if **name** is a valid
    distribution name before normalizing.

    :param str name: The name to normalize.
    :param bool validate: Check whether the name is a valid distribution name.
    :raises InvalidName: If **validate** is true and the name is not an
        acceptable distribution name.

    >>> from packaging.utils import canonicalize_name
    >>> canonicalize_name("Django")
    'django'
    >>> canonicalize_name("oslo.concurrency")
    'oslo-concurrency'
    >>> canonicalize_name("requests")
    'requests'

    .. versionadded:: 16.2

    .. versionchanged:: 20.4
       The return type was changed to :class:`NormalizedName`.

    .. versionchanged:: 23.2
       Added the *validate* keyword parameter.
    zname is invalid: �_�-�.z--r)�_validate_regex�	fullmatchr�lower�replacer)�namer(�values   rrrRs}��B��1�1�$�7��-�d�X�6�7�7�
�J�J�L� � ��c�*�2�2�3��<�E�
�%�-��
�
�d�C�(���%�-�� �%�(�(rc�0�tj|�duS)a5
    Check if a name is a normalized project name (i.e. a valid name that
    :func:`canonicalize_name` would roundtrip to the same value).

    The roundtrip only characterizes normalized names for *valid* names. A name
    must start and end with an ASCII letter or digit, which
    :func:`canonicalize_name` does not enforce: it leaves a leading or trailing
    hyphen in place, so such a name roundtrips without being normalized.

    :param str name: The name to check.

    >>> from packaging.utils import canonicalize_name, is_normalized_name
    >>> is_normalized_name("requests")
    True
    >>> is_normalized_name("Django")
    False
    >>> canonicalize_name("_not_legal")
    '-not-legal'
    >>> is_normalized_name("-not-legal")  # roundtrips, but not a valid name
    False

    .. versionadded:: 23.2
    N)�_normalized_regexr.)r1s rrrs��0�&�&�t�,�D�8�8rT)�strip_trailing_zeroc��t|t�r	t|�}t|rt	|��S|�S#t$rt|�cYSwxYw)a�Return a canonical form of a version as a string.

    This function takes a string representing a package version (or a
    :class:`~packaging.version.Version` instance), and returns the
    normalized form of it. By default, it strips trailing zeros from
    the release segment.

    >>> from packaging.utils import canonicalize_version
    >>> canonicalize_version('1.0.1')
    '1.0.1'

    Per PEP 625, versions may have multiple canonical forms, differing
    only by trailing zeros.

    >>> canonicalize_version('1.0.0')
    '1'
    >>> canonicalize_version('1.0.0', strip_trailing_zero=False)
    '1.0.0'

    Invalid versions are returned unaltered.

    >>> canonicalize_version('foo bar baz')
    'foo bar baz'

    >>> canonicalize_version('1.4.0.0.0')
    '1.4'

    .. versionadded:: 17.1

    .. versionchanged:: 21.0
       The return type was narrowed to :class:`str`.

    .. versionchanged:: 22.0
       Added the *strip_trailing_zero* keyword parameter.
    )�
isinstance�strr
rr)�versionr5s  rrr�sV��L�'�3��	 ��g�&�G��+>��w�'�L�L�G�L�L���	 ��w�<��	 �s�9�A�A��validate_orderc���|jd�std|����|dd}|jd�}|dvrtd|����|jd|dz
�}|d	}d
|vstj|��td|����t
|�}	t|d�}|dk(rc|d}tj|�}	|	�td|�d|����tdt|	jd��|	jd�f�}
nd}
|d}	t||��}|||
|fS#t$r}td
|���|�d}~wwxYw#t$rtd|���d�t$rtd|���d�wxYw)am
    This function takes the filename of a wheel file, and parses it,
    returning a tuple of name, version, build number, and tags.

    The name part of the tuple is normalized and typed as
    :class:`NormalizedName`. The version portion is an instance of
    :class:`~packaging.version.Version`. The build number is ``()`` if
    there is no build number in the wheel filename, otherwise a
    two-item tuple of an integer for the leading digits and
    a string for the rest of the build number. The tags portion is a
    frozen set of :class:`~packaging.tags.Tag` instances (as the tag
    string format allows multiple tags to be combined into a single
    string).

    If **validate_order** is true, compressed tag set components are
    checked to be in sorted order as required by PEP 425.

    :param str filename: The name of the wheel file.
    :param bool validate_order: Check whether compressed tag set components
        are in sorted order.
    :raises InvalidWheelFilename: If the filename in question
        does not follow the :ref:`wheel specification
        <pypug:binary-distribution-format>`.

    >>> from packaging.utils import parse_wheel_filename
    >>> from packaging.tags import Tag
    >>> from packaging.version import Version
    >>> name, ver, build, tags = parse_wheel_filename("foo-1.0-py3-none-any.whl")
    >>> name
    'foo'
    >>> ver == Version('1.0')
    True
    >>> tags == {Tag("py3", "none", "any")}
    True
    >>> not build
    True

    .. versionadded:: 20.9

    .. versionchanged:: 23.2
       Raises :class:`InvalidWheelFilename` when the version component is invalid.

    .. versionadded:: 26.1
       The *validate_order* parameter.

    .. versionchanged:: 26.3
       Raises :class:`InvalidWheelFilename` when an interpreter component is
       not an identifier, a tag set component is empty, or the project name is
       empty.
    z.whlz3Invalid wheel filename (extension must be '.whl'): N���r+)��z0Invalid wheel filename (wrong number of parts): �r�__zInvalid project name: rz*Invalid wheel filename (invalid version): r?zInvalid build number: z in rr���r:z\Invalid wheel filename (compressed tag set components must be in sorted order per PEP 425): z0Invalid wheel filename (invalid tag component): )�endswithr�count�split�_wheel_name_regex�matchrr
r�_build_tag_regexr�int�grouprr
r)
�filenamer;�dashes�parts�	name_partr1r9�e�
build_part�build_match�build�tag_str�tagss
             rrr�s���n���V�$�"�A�(��N�
�	
����}�H�
�^�^�C�
 �F�
�V��"�>�x�l�K�
�	
�
�N�N�3���
�+�E��a��I��y��-�3�3�I�>�F�"�%;�H�<�#H�I�I��Y�'�D���%��(�#����{��1�X�
�&�,�,�Z�8����&�(���D���E��
��Z�#�k�&7�&7��&:�";�[�=N�=N�q�=Q�!R�S�����B�i�G�
����@��
�'�5�$�'�'��7��"�8���E�
��	����$��"�*�*2��
7�
��	���"�>�x�l�K�
��	��s$�D&�
E�&	E�/D>�>E�0E6c��|jd�r|dtd�}n/|jd�r|dtd�}ntd|����|jd�\}}}|std|����|std|����t	|�}	t|�}||fS#t$r}td|���|�d}~wwxYw)	a5
    This function takes the filename of a sdist file (as specified
    in the `Source distribution format`_ documentation), and parses
    it, returning a tuple of the normalized name and version as
    represented by an instance of :class:`~packaging.version.Version`.

    :param str filename: The name of the sdist file.
    :raises InvalidSdistFilename: If the filename does not end
        with an sdist extension (``.zip`` or ``.tar.gz``), if it does not
        contain a dash separating the name and the version of the distribution,
        if the project name is empty, or if the version portion is not a valid
        version.

    >>> from packaging.utils import parse_sdist_filename
    >>> from packaging.version import Version
    >>> name, ver = parse_sdist_filename("foo-1.0.tar.gz")
    >>> name
    'foo'
    >>> ver == Version('1.0')
    True

    .. versionadded:: 20.9

    .. versionchanged:: 21.0
       Added support for ``.zip`` source distributions.

    .. versionchanged:: 23.2
       Raises :class:`InvalidSdistFilename` when the version component is invalid.

    .. versionchanged:: 26.3
       Raises :class:`InvalidSdistFilename` on an empty project name.

    .. _Source distribution format: https://packaging.python.org/specifications/source-distribution-format/#source-distribution-file-name
    z.tar.gzNz.zipz@Invalid sdist filename (extension must be '.tar.gz' or '.zip'): r+zInvalid sdist filename: z-Invalid sdist filename (empty project name): z*Invalid sdist filename (invalid version): )rC�lenr�
rpartitionrr
r)rK�	file_stemrN�sep�version_partr1r9rOs        rrr2s���F����#��.��I���/�	�	�	�	�6�	"��^��F��|�,�	�"���|�
�
�	
�$-�#7�#7��#<� �I�s�L��"�%=�h�\�#J�K�K��"�;�H�<�H�
�	
��Y�'�D���,�'��
�'�?�����"�8���E�
��	���s�B!�!	B>�*B9�9B>)�returnz	list[str])r1r8r(�boolr[r)r1r8r[r\)r9z
Version | strr5r\r[r8)rKr8r;r\r[z8tuple[NormalizedName, Version, BuildTag, frozenset[Tag]])rKr8r[ztuple[NormalizedName, Version])(�
__future__r�re�typingrrrrTrr	r
rr9rr
rrr�tuplerIr8rr�
ValueErrorrrr�compile�
IGNORECASE�ASCIIr-r4rH�UNICODErFrrrrrrrr�<module>rfs\��
#�	�'�'�?�?�=�=������r��E�#�s�(�O�+�,����)�3�/����*���:���:���"�*�*�,�b�m�m�b�h�h�.F����B�J�J�:�B�H�H�E���2�:�:�l�B�H�H�5���B�J�J�}�b�j�j�9��6;�*)�Z9�8<@�+M�
�+M�48�+M��+M�b!�g(��g(��g(�>�	g(�T@r

Youez - 2016 - github.com/yon3zu
LinuXploit