Your IP : 216.73.216.213
B
h� Y�# � @ s� d Z ddlmZmZ ddlZddlZejdk r4dZndZyeZ W n e
k
r\ dd� Z Y nX d d
� ZeG dd� de��Z
e
� Z
G d
d� de�ZeG dd� de��Zdd� Zdd� ZddlmZ dddgZdS )z0
Versions for Python packages.
See L{Version}.
� )�division�absolute_importN)� r FTc C s | |k rdS | |krdS dS dS )z�
Compare two objects.
Returns a negative number if C{a < b}, zero if they are equal, and a
positive number if C{a > b}.
���r � N� )�a�br r �E/opt/alt/python37/lib/python3.7/site-packages/incremental/__init__.py�_cmp s
r c C s` t s| S dd� }dd� }dd� }dd� }d d
� }dd� }|| _|| _|| _|| _|| _|| _| S )
z�
Class decorator that ensures support for the special C{__cmp__} method.
On Python 2 this does nothing.
On Python 3, C{__eq__}, C{__lt__}, etc. methods are added to the class,
relying on C{__cmp__} to implement their comparisons.
c S s | � |�}|tkr|S |dkS )Nr )�__cmp__�NotImplemented)�self�other�cr r r
�__eq__7 s
z_comparable.<locals>.__eq__c S s | � |�}|tkr|S |dkS )Nr )r r
)r r r r r r
�__ne__= s
z_comparable.<locals>.__ne__c S s | � |�}|tkr|S |dk S )Nr )r r
)r r r r r r
�__lt__C s
z_comparable.<locals>.__lt__c S s | � |�}|tkr|S |dkS )Nr )r r
)r r r r r r
�__le__I s
z_comparable.<locals>.__le__c S s | � |�}|tkr|S |dkS )Nr )r r
)r r r r r r
�__gt__O s
z_comparable.<locals>.__gt__c S s | � |�}|tkr|S |dkS )Nr )r r
)r r r r r r
�__ge__U s
z_comparable.<locals>.__ge__)�_PY3r r r r r r )�klassr r r r r r r r r
�_comparable* s
r c @ s e Zd ZdZdd� ZdS )�_infz:
An object that is bigger than all other objects.
c C s |t krdS dS )z�
@param other: Another object.
@type other: any
@return: 0 if other is inf, 1 otherwise.
@rtype: C{int}
r r )r )r r r r r
r m s z_inf.__cmp__N)�__name__�
__module__�__qualname__�__doc__r r r r r
r h s r c @ s e Zd ZdZdS )�IncomparableVersionsz-
Two versions could not be compared.
N)r r r r r r r r
r } s r c @ sR e Zd ZdZddd�Zedd� �Zdd� ZeZeZ eZ
d d
� Zdd� Zd
d� Z
dS )�Versionz�
An encapsulation of a version for a project, with support for outputting
PEP-440 compatible version strings.
This class supports the standard major.minor.micro[rcN] scheme of
versioning.
Nc C sv |r|rt d��n|r.|s.|}tjdtdd� |dkrN|sF|sF|sF|rNt d��|| _|| _|| _|| _|| _|| _ dS )a�
@param package: Name of the package that this is a version of.
@type package: C{str}
@param major: The major version number.
@type major: C{int} or C{str} (for the "NEXT" symbol)
@param minor: The minor version number.
@type minor: C{int}
@param micro: The micro version number.
@type micro: C{int}
@param release_candidate: The release candidate number.
@type release_candidate: C{int}
@param prerelease: The prerelease number. (Deprecated)
@type prerelease: C{int}
@param dev: The development release number.
@type dev: C{int}
z Please only return one of these.zvPassing prerelease to incremental.Version was deprecated in Incremental 16.9.0. Please pass release_candidate instead.� )�
stacklevel�NEXTz;When using NEXT, all other values except Package must be 0.N)
�
ValueError�warnings�warn�DeprecationWarning�package�major�minor�micro�release_candidate�dev)r r( r) r* r+ r, �
prereleaser- r r r
�__init__� s
zVersion.__init__c C s t jdtdd�f | jS )NzuAccessing incremental.Version.prerelease was deprecated in Incremental 16.9.0. Use Version.release_candidate instead.r! )r"