HEX
Server: LiteSpeed
System: Linux vearitale.com 5.14.0-570.32.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 6 11:30:41 EDT 2025 x86_64
User: yunab9059 (2007)
PHP: 8.3.21
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.9/site-packages/distlib/__pycache__/markers.cpython-39.pyc
a

��h��@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZdgZ
e�d�Zd	d
hZdd�Zd
d�Zdd�ZGdd�de�Ze�d�Zdd�Ze�Z[e�Zddd�Zddd�ZdS)zG
Parser for the environment markers micro-language defined in PEP 508.
�N�)�string_types)�in_venv�parse_marker)�
LegacyVersion�	interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")�python_version�python_full_versioncCst|t�o|tvS�N)�
isinstancer�_VERSION_MARKERS��s�r�9/usr/local/lib/python3.9/site-packages/distlib/markers.py�_is_version_markersrcCst|t�r|sdS|ddvS)NFr�'")rr)�orrr�_is_literal"srcCsdd�t�|�D�S)NcSsh|]}t|��d��qS)r)�LV�groups)�.0�mrrr�	<setcomp>)�z _get_versions.<locals>.<setcomp>)�_VERSION_PATTERN�finditerr
rrr�
_get_versions(src
@sfeZdZdZdd�dd�dd�dd�dd�dd�d	d�d
d�dd�dd�d
d�dd�d�Zdd�ZdS)�	Evaluatorz<
    This class is used to evaluate marker expressions.
    cCs||kSr
r��x�yrrr�<lambda>2rzEvaluator.<lambda>cCs||kSr
rrrrrr"3rcCs||kp||kSr
rrrrrr"4rcCs||kSr
rrrrrr"5rcCs||kSr
rrrrrr"6rcCs||kp||kSr
rrrrrr"7rcCs||kSr
rrrrrr"8rcCs||kp||kSr
rrrrrr"9rcCs|o|Sr
rrrrrr":rcCs|p|Sr
rrrrrr";rcCs||vSr
rrrrrr"<rcCs||vSr
rrrrrr"=r)�==�===�~=�!=�<�<=�>�>=�and�or�in�not inc	Cs"t|t�rB|ddvr$|dd�}n||vr8td|��||}n�t|t�sPJ�|d}||jvrntd|��|d}|d	}t|d�r�t|d	�r�td
|||f��|�||�}|�||�}t|�s�t|�r�|dvr�t	|�}t	|�}n$t|��r|dv�rt	|�}t
|�}|j|||�}|S)
z�
        Evaluate a marker expression returned by the :func:`parse_requirement`
        function in the specified context.
        rrr���zunknown variable: %s�opzop not implemented: %s�lhs�rhszinvalid comparison: %s %s %s)r'r(r)r*r$r#r&r%)r-r.)rr�SyntaxError�dict�
operations�NotImplementedErrorr�evaluaterrr)	�self�expr�context�resultr0ZelhsZerhsr1r2rrrr7@s4


�
zEvaluator.evaluateN)�__name__�
__module__�__qualname__�__doc__r5r7rrrrr,s�rz\d+\.\d+c
Cs�dd�}ttd�r(|tjj�}tjj}nd}d}t��}t�|�}|�	d�}||t
jt��t��t�
�t��t��tt��||tjd�}|S)NcSs<d|j|j|jf}|j}|dkr8||dt|j�7}|S)Nz%s.%s.%s�finalr)�major�minor�micro�releaselevel�str�serial)�info�version�kindrrr�format_full_versionhs
z,default_context.<locals>.format_full_version�implementation�0�r)�implementation_name�implementation_version�os_name�platform_machine�platform_python_implementation�platform_release�platform_system�platform_versionZplatform_in_venvr	r�sys_platform)�hasattr�sysrKrH�name�platformr�_DIGITS�match�group�os�machine�python_implementation�release�systemrEr)rJrOrNZppvr�pvr;rrr�default_contextfs.



�rdcCs"tt�}|r|�|�t�||�Sr
)r4�DEFAULT_CONTEXT�update�	evaluatorr7)r9�execution_contextr:rrr�interpret_parsed�s
ric
Cspzt|�\}}Wn4tyD}ztd||f��WYd}~n
d}~00|rf|ddkrftd||f��t||�S)z�
    Interpret a marker and return a result depending on environment.

    :param marker: The marker to interpret.
    :type marker: str
    :param execution_context: The context used for name lookup.
    :type execution_context: mapping
    z)Unable to interpret marker syntax: %s: %sNr�#z*unexpected trailing data in marker: %s: %s)r�	Exceptionr3ri)�markerrhr9�rest�errrr�s	&)N)N)r?r^�rerXrZ�compatr�utilrrrHrr�__all__�compilerrrrr�objectrr[rdrergrirrrrr�<module>s*
7
$