Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/incremental/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/incremental/__pycache__/__init__.cpython-37.pyc

B

h� Y�#�@s�dZddlmZmZddlZddlZejdkr4dZndZyeZ	Wne
k
r\dd�Z	YnXd	d
�ZeGdd�de��Z
e
�Z
Gd
d�de�ZeGdd�de��Zdd�Zdd�ZddlmZdddgZdS)z0
Versions for Python packages.

See L{Version}.
�)�division�absolute_importN)�rFTcCs ||krdS||krdSdSdS)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�brr�E/opt/alt/python37/lib/python3.7/site-packages/incremental/__init__.py�_cmps
rcCs`ts|Sdd�}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.
    cSs|�|�}|tkr|S|dkS)Nr)�__cmp__�NotImplemented)�self�other�crrr
�__eq__7s
z_comparable.<locals>.__eq__cSs|�|�}|tkr|S|dkS)Nr)rr
)rrrrrr
�__ne__=s
z_comparable.<locals>.__ne__cSs|�|�}|tkr|S|dkS)Nr)rr
)rrrrrr
�__lt__Cs
z_comparable.<locals>.__lt__cSs|�|�}|tkr|S|dkS)Nr)rr
)rrrrrr
�__le__Is
z_comparable.<locals>.__le__cSs|�|�}|tkr|S|dkS)Nr)rr
)rrrrrr
�__gt__Os
z_comparable.<locals>.__gt__cSs|�|�}|tkr|S|dkS)Nr)rr
)rrrrrr
�__ge__Us
z_comparable.<locals>.__ge__)�_PY3rrrrrr)�klassrrrrrrrrr
�_comparable*s
rc@seZdZdZdd�ZdS)�_infz:
    An object that is bigger than all other objects.
    cCs|tkrdSdS)z�
        @param other: Another object.
        @type other: any

        @return: 0 if other is inf, 1 otherwise.
        @rtype: C{int}
        rr)r)rrrrr
rmsz_inf.__cmp__N)�__name__�
__module__�__qualname__�__doc__rrrrr
rhsrc@seZdZdZdS)�IncomparableVersionsz-
    Two versions could not be compared.
    N)rrrrrrrr
r}src@sReZdZdZddd�Zedd��Zdd�ZeZeZ	eZ
d	d
�Zdd�Zd
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.
    NcCsv|r|rtd��n|r.|s.|}tjdtdd�|dkrN|sF|sF|sF|rNtd��||_||_||_||_||_||_	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)rr(r)r*r+r,�
prereleaser-rrr
�__init__�s

zVersion.__init__cCstjdtdd�f|jS)NzuAccessing incremental.Version.prerelease was deprecated in Incremental 16.9.0. Use Version.release_candidate instead.r!)r")r%r&r'r,)rrrr
r.�szVersion.prereleasecCs`|jdkr|jS|jdkr d}nd|jf}|jdkr<d}nd|jf}d|j|j|j||fS)z�
        Return a PEP440-compatible "public" representation of this L{Version}.

        Examples:

          - 14.4.0
          - 1.2.3rc1
          - 14.2.1rc1dev9
          - 16.04.0dev0
        r#N�zrc%szdev%sz%r.%d.%d%s%s)r)r,r-r*r+)r�rcr-rrr
�public�s


zVersion.publiccCsZ|jdkrd}nd|jf}|jdkr,d}nd|jf}d|jj|j|j|j|j||fS)Nr0z, release_candidate=%rz, dev=%rz%s(%r, %r, %d, %d%s%s))r,r-�	__class__rr(r)r*r+)rr,r-rrr
�__repr__�s


zVersion.__repr__cCsd|j|��fS)Nz[%s, version %s])r(�short)rrrr
�__str__�szVersion.__str__c	Cs�t||j�stS|j��|j��kr8td|j|jf��|jdkrHt}n|j}|jdkr^t}n|j}|j	dkrtt}n|j	}|jdkr�t}n|j}|jdkr�t}n|j}|j	dkr�t}n|j	}t
||j|j||f||j|j||f�}|S)a�
        Compare two versions, considering major versions, minor versions, micro
        versions, then release candidates. Package names are case insensitive.

        A version with a release candidate is always less than a version
        without a release candidate. If both versions have release candidates,
        they will be included in the comparison.

        @param other: Another version.
        @type other: L{Version}

        @return: NotImplemented when the other object is not a Version, or one
            of -1, 0, or 1.

        @raise IncomparableVersions: when the package names of the versions
            differ.
        z%r != %rr#N)
�
isinstancer3r
r(�lowerrr)rr,r-rr*r+)	rrr)r,r-�
othermajor�otherrc�otherdev�xrrr
r�sD





zVersion.__cmp__)NNN)rrrrr/�propertyr.r2�baser5�localr4r6rrrrr
r �s
&r cCsd|j|��f}|S)z�
    Get a friendly string for the given version object.

    @param version: A L{Version} object.
    @return: A string containing the package and short version number.
    z%s %s)r(r5)�version�resultrrr
�getVersionString:srBc
Cs�|sdSddlm}|�|�}|��xZ|��D]N}|ddkr0i}t|d��}t|��|�WdQRX|d��|j_	dSq0Wt
d��dS)	zF
    Get the version from the package listed in the Distribution.
    Nr)�build_pyr�_versionr!�__version__zNo _version.py found.)�distutils.commandrC�finalize_options�find_all_modules�open�exec�readr2�metadatar@�	Exception)�dist�keyword�valuerC�
sp_command�item�version_file�frrr
�_get_versionEs
rUr)rErE)r�
__future__rr�sysr%�version_inforZcmpr�	NameErrorr�objectr�	TypeErrorrr rBrUrDrE�__all__rrrr
�<module>s,
>7