관리-도구
편집 파일: markers.cpython-37.pyc
B :��a� � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZm Z ddl mZ dgZ e�d�Zd d � Zdd� ZG d d� de�Ze�d�Zdd� Ze� Z[e� Zddd�ZdS )zG Parser for the environment markers micro-language defined in PEP 508. � N� )�string_types)�in_venv�parse_marker)�NormalizedVersion� interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")c C s t | t�r| sdS | d dkS )NFr z'")� isinstancer )�o� r �@/opt/alt/python37/lib/python3.7/site-packages/distlib/markers.py�_is_literal s r c C s6 g }x(t �| �D ]}|�t|�� d �� qW t|�S )Nr )�_VERSION_PATTERN�finditer�append�NV�groups�set)�s�result�mr r r � _get_versions! s r c @ sf e Zd ZdZdd� dd� dd� dd� dd� dd� d d� d d� dd� dd� d d� dd� d�Zdd� ZdS )� Evaluatorz; This class is used to evaluate marker expessions. c C s | |kS )Nr )�x�yr r r �<lambda>- � zEvaluator.<lambda>c C s | |kS )Nr )r r r r r r . r c C s | |kp| |kS )Nr )r r r r r r / r c C s | |kS )Nr )r r r r r r 0 r c C s | |k S )Nr )r r r r r r 1 r c C s | |kp| |k S )Nr )r r r r r r 2 r c C s | |kS )Nr )r r r r r r 3 r c C s | |kp| |kS )Nr )r r r r r r 4 r c C s | o|S )Nr )r r r r r r 5 r c C s | p|S )Nr )r r r r r r 6 r c C s | |kS )Nr )r r r r r r 7 r c C s | |kS )Nr )r r r r r r 8 r )z==z===z~=z!=�<z<=�>z>=�and�or�inznot inc C s" t |t�rB|d dkr$|dd� }n||kr8td| ��|| }n�t |t�sPt�|d }|| jkrntd| ��|d }|d }t|d �r�t|d �r�td |||f ��| �||�}| �||�}|dks�|dkr�|dkr�t |�}t |�}n$|dk�r|d k�rt |�}t |�}| j| ||�}|S )z� Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. r z'"r ���zunknown variable: %s�opzop not implemented: %s�lhs�rhszinvalid comparison: %s %s %s�python_version)r z<=r z>=z===z==z!=z~=)r znot in)r r �SyntaxError�dict�AssertionError� operations�NotImplementedErrorr �evaluater r ) �self�expr�contextr r"