관리-도구
편집 파일: specifiers.cpython-36.opt-1.pyc
3 9��fym � @ s� d dl mZmZmZ d dlZd dlZd dlZd dlZddlm Z m Z ddlmZm Z mZ G dd� de�ZG dd � d e eje��ZG d d� de�ZG dd � d e�Zdd� ZG dd� de�Zejd�Zdd� Zdd� ZG dd� de�ZdS )� )�absolute_import�division�print_functionN� )�string_types�with_metaclass)�Version� LegacyVersion�parsec @ s e Zd ZdZdS )�InvalidSpecifierzH An invalid specifier was found, users should refer to PEP 440. N)�__name__� __module__�__qualname__�__doc__� r r � /usr/lib/python3.6/specifiers.pyr s r c @ s� e Zd Zejdd� �Zejdd� �Zejdd� �Zejdd� �Zej d d � �Z e jdd � �Z ejdd d��Zejddd��Z dS )� BaseSpecifierc C s dS )z� Returns the str representation of this Specifier like object. This should be representative of the Specifier itself. Nr )�selfr r r �__str__ s zBaseSpecifier.__str__c C s dS )zF Returns a hash value for this Specifier like object. Nr )r r r r �__hash__ s zBaseSpecifier.__hash__c C s dS )zq Returns a boolean representing whether or not the two Specifier like objects are equal. Nr )r �otherr r r �__eq__$ s zBaseSpecifier.__eq__c C s dS )zu Returns a boolean representing whether or not the two Specifier like objects are not equal. Nr )r r r r r �__ne__+ s zBaseSpecifier.__ne__c C s dS )zg Returns whether or not pre-releases as a whole are allowed by this specifier. Nr )r r r r �prereleases2 s zBaseSpecifier.prereleasesc C s dS )zd Sets whether or not pre-releases as a whole are allowed by this specifier. Nr )r �valuer r r r 9 s Nc C s dS )zR Determines if the given item is contained within this specifier. Nr )r �itemr r r r �contains@ s zBaseSpecifier.containsc C s dS )z� Takes an iterable of items and filters them so that only items which are contained within this specifier are allowed in it. Nr )r �iterabler r r r �filterF s zBaseSpecifier.filter)N)N)r r r �abc�abstractmethodr r r r �abstractpropertyr �setterr r r r r r r s r c @ s� e Zd Zi Zd dd�Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zedd� �Z edd� �Zedd� �Zejdd� �Zdd� Zd!dd�Zd"dd�ZdS )#�_IndividualSpecifier� Nc C sF | j j|�}|stdj|���|jd�j� |jd�j� f| _|| _d S )NzInvalid specifier: '{0}'�operator�version)�_regex�searchr �format�group�strip�_spec�_prereleases)r �specr �matchr r r �__init__R s z_IndividualSpecifier.__init__c C s0 | j d k rdj| j�nd}dj| jjt| �|�S )Nz, prereleases={0!r}r$ z<{0}({1!r}{2})>)r- r) r � __class__r �str)r �prer r r �__repr___ s z_IndividualSpecifier.__repr__c C s dj | j� S )Nz{0}{1})r) r, )r r r r r l s z_IndividualSpecifier.__str__c C s t | j�S )N)�hashr, )r r r r r o s z_IndividualSpecifier.__hash__c C sL t |t�r0y| j|�}W q@ tk r, tS X nt || j�s@tS | j|jkS )N)� isinstancer r1 r �NotImplementedr, )r r r r r r r s z_IndividualSpecifier.__eq__c C sL t |t�r0y| j|�}W q@ tk r, tS X nt || j�s@tS | j|jkS )N)r6 r r1 r r7 r, )r r r r r r } s z_IndividualSpecifier.__ne__c C s t | dj| j| ��S )Nz_compare_{0})�getattrr) � _operators)r �opr r r � _get_operator� s z"_IndividualSpecifier._get_operatorc C s t |ttf�st|�}|S )N)r6 r r r )r r&