HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/self/root/lib/python3/dist-packages/incremental/__pycache__/__init__.cpython-38.pyc
U

@�=`�&�@s�dZddlmZmZddlZddlZejdkr4dZndZzeZ	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�6/usr/lib/python3/dist-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__8s
z_comparable.<locals>.__eq__cSs|�|�}|tkr|S|dkSrr
rrrr
�__ne__>s
z_comparable.<locals>.__ne__cSs|�|�}|tkr|S|dkSrr
rrrr
�__lt__Ds
z_comparable.<locals>.__lt__cSs|�|�}|tkr|S|dkSrr
rrrr
�__le__Js
z_comparable.<locals>.__le__cSs|�|�}|tkr|S|dkSrr
rrrr
�__gt__Ps
z_comparable.<locals>.__gt__cSs|�|�}|tkr|S|dkSrr
rrrr
�__ge__Vs
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
rpsz_inf.__cmp__N)�__name__�
__module__�__qualname__�__doc__rrrrr
rjsrc@seZdZdZdS)�IncomparableVersionsz-
    Two versions could not be compared.
    N)rrr r!rrrr
r"�sr"c@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.
    Nc		Cs�|r|rtd��n|r.|s.|}tjdtdd�|dkrR|sJ|sJ|sJ|sJ|rRtd��||_||_||_||_||_||_	||_
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 post: The postrelease number.
        @type post: 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�post�dev)	rr,r-r.r/r0�
prereleaser1r2rrr
�__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+r0�rrrr
r3�s�	zVersion.prereleasecCs~|jdkr|jS|jdkr d}nd|jf}|jdkr<d}nd|jf}|jdkrXd}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�z.rc%sz.post%sz.dev%sz%r.%d.%d%s%s%s)r-r0r1r2r.r/)rZrcr1r2rrr
�public�s



zVersion.publicc	Csx|jdkrd}nd|jf}|jdkr,d}nd|jf}|jdkrHd}nd|jf}d|jj|j|j|j|j|||fS)Nr6z, release_candidate=%rz	, post=%rz, dev=%rz%s(%r, %r, %d, %d%s%s%s))	r0r1r2�	__class__rr,r-r.r/)rr0r1r2rrr
�__repr__�s&


�zVersion.__repr__cCsd|j|��fS)Nz[%s, version %s]�r,�shortr5rrr
�__str__szVersion.__str__cCst||j�stS|j��|j��kr8td|j|jf��|jdkrHt}n|j}|jdkr^t}n|j}|j	dkrtd}n|j	}|j
dkr�t}n|j
}|jdkr�t}n|j}|jdkr�t}n|j}|j	dkr�d}n|j	}|j
dkr�t}	n|j
}	t||j|j
|||f||j|j
|||	f�}
|
S)aw
        Compare two versions, considering major versions, minor versions, micro
        versions, then release candidates, then postreleases, then dev
        releases. 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.

        Likewise, a version with a dev release is always less than a version
        without a dev release. If both versions have dev releases, 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'Nr)�
isinstancer8rr,�lowerr"r-rr0r1r2rr.r/)rrr-r0r1r2Z
othermajorZotherrcZ	otherpostZotherdev�xrrr
rsB







�zVersion.__cmp__)NNNN)rrr r!r4�propertyr3r7�baser;Zlocalr9r<rrrrr
r#�s�
9
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 %sr:)�version�resultrrr
�getVersionStringcsrDc
Cs�|sdSddlm}|�|�}|��|��D]P}|ddkr.i}t|d��}t|��|�W5QRX|d��|j_	dSq.t
d��dS)	zF
    Get the version from the package listed in the Distribution.
    Nr)�build_pyr�_versionr$�__version__zNo _version.py found.)Zdistutils.commandrEZfinalize_optionsZfind_all_modules�open�exec�readr7ZmetadatarB�	Exception)Zdist�keyword�valuerEZ
sp_command�itemZversion_file�frrr
�_get_versionns
rPr)rGrG)r!Z
__future__rr�sysr)�version_inforZcmpr�	NameErrorr�objectr�	TypeErrorr"r#rDrPrFrG�__all__rrrr
�<module>s,
?]