[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.147.66.200: ~ $


�V�H�@srdZddlZddlZddlZddlZdd�ZGdd�de�ZGdd�de�ZdS)	z9
Utilities for consuming the version from pkg_resources.
�NcCs/yt|�dSWntk
r*dSYnXdS)NTF)�int�
ValueError)�string�r�/version.py�_is_ints


rc@s$eZdZdZddddddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
edd��Zdd�Zdd�Zdd�Zd d d!d"�Zd#d$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�ZdS).�SemanticVersionzvA pure semantic version independent of serialisation.

    See the pbr doc 'semver' for details on the semantics.
    rNcCs\||_||_||_||_||_|jrI|jrId|_|pRd|_dS)a
Create a SemanticVersion.

        :param major: Major component of the version.
        :param minor: Minor component of the version. Defaults to 0.
        :param patch: Patch level component. Defaults to 0.
        :param prerelease_type: What sort of prerelease version this is -
            one of a(alpha), b(beta) or rc(release candidate).
        :param prerelease: For prerelease versions, what number prerelease.
            Defaults to 0.
        :param dev_count: How many commits since the last release.
        rN)�_major�_minor�_patch�_prerelease_type�_prerelease�
_dev_count)�self�major�minor�patch�prerelease_type�
prerelease�	dev_countrrr�__init__*s						zSemanticVersion.__init__cCs#t|t�sdS|j|jkS)NF)�
isinstancer�__dict__)r�otherrrr�__eq__AszSemanticVersion.__eq__cCsttt|jj���S)N)�sum�map�hashr�values)rrrr�__hash__FszSemanticVersion.__hash__cCsxddddddddi}|jr:|jr:d}nd}|j|j|j|||j|j|jpttjfS)z.Return a key for sorting SemanticVersion's on.�a�b�rcN�zr�)rrr	r
rr
�sys�maxsize)rZ	rc_lookupZuq_devrrr�	_sort_keyIs	zSemanticVersion._sort_keycCs1t|t�std��|j�|j�kS)z1Compare self and other, another Semantic Version.z,ordering to non-SemanticVersion is undefined)rr�	TypeErrorr')rrrrr�__lt__`szSemanticVersion.__lt__cCs||kp||kS)Nr)rrrrr�__le__jszSemanticVersion.__le__cCs||kS)Nr)rrrrr�__ge__mszSemanticVersion.__ge__cCs||kS)Nr)rrrrr�__gt__pszSemanticVersion.__gt__cCs||kS)Nr)rrrrr�__ne__sszSemanticVersion.__ne__cCsd|j�S)Nzpbr.version.SemanticVersion(%s))�release_string)rrrr�__repr__vszSemanticVersion.__repr__cCsg|dd�j�s&td|��|jd�}dd�|D�}t|�}|dkrstd|��n�|dkr)|t|�kr||dj�r||}d	jtjd
d�|��}|j|�||t|�d�g|||d�<|d7}|jdgd|�|j||d��t	|d�}t	|d�}d}	d}
d}d}dd
�}
t
|d�r�t	|d�}nd}dg|dd�<|dd�}d}y |r�t	|d�r�d}Wntk
r
YnX|r$t	|d�}	n�|rx|dddksR|dddkrx|
|d�\}}|dd�}x�|r
|d}|jd�r�t	|dd��}	nD|jd�r�d}	t	|dd��}
ntd||f��|dd�}q{Wt|||d|d|d|	�}|
rc|	rNtd|f��|j
�j|
�}|S)a�Create a SemanticVersion from a pip version string.

        This method will parse a version like 1.3.0 into a SemanticVersion.

        This method is responsible for accepting any version string that any
        older version of pbr ever created.

        Therefore: versions like 1.3.0a1 versions are handled, parsed into a
        canonical form and then output - resulting in 1.3.0.0a1.
        Pre pbr-semver dev versions like 0.10.1.3.g83bef74 will be parsed but
        output as 0.10.1.dev3.g83bef74.

        :raises ValueError: Never tagged versions sdisted by old pbr result in
            just the git hash, e.g. '1234567' which poses a substantial problem
            since they collide with the semver versions when all the digits are
            numerals. Such versions will result in a ValueError being thrown if
            any non-numeric digits are present. They are an exception to the
            general case of accepting anything we ever output, since they were
            never intended and would permanently mess up versions on PyPI if
            ever released - we're treating that as a critical bug that we ever
            made them and have stopped doing that.
        Nr$zInvalid version %r�.cSs"g|]}|j�r|�qSr)�isdigit)�.0�crrr�
<listcomp>�s	z3SemanticVersion.from_pip_string.<locals>.<listcomp>r��cSs
|j�S)N)r1)�xrrr�<lambda>�sz1SemanticVersion.from_pip_string.<locals>.<lambda>cSsztjd�}djtj||��}tjd�}djtj||��}|t|�d�}|t|�fS)Nr1r6�isalpha)�operator�methodcaller�join�	itertools�	dropwhile�	takewhile�lenr)Zsegmentr1r9rrrrr�_parse_type�sz4SemanticVersion.from_pip_string.<locals>._parse_type�FT�0r r!�r�devZpost�zUnknown remainder %r in %rrrrz0Cannot combine postN and devN - no mapping in %r)r r!rD)r1r�splitr@r<r=r?�append�extendrr�
startswithr�	increment�to_dev)�klass�version_stringZinput_components�
componentsZ	digit_lenZmixed_componentZlast_componentrrrZ
post_countrrrAr�	remainderZremainder_starts_with_intZ	component�resultrrr�from_pip_stringys~

*


	

zSemanticVersion.from_pip_stringcCsd|j|j|jfS)z3Return the short version minus any alpha/beta tags.z%s.%s.%s)r	r
r)rrrr�brief_string�szSemanticVersion.brief_stringcCs
|jd�S)z�Return the version number to use when building a debian package.

        This translates the PEP440/semver precedence rules into Debian version
        sorting operators.
        �~)�
_long_version)rrrr�
debian_string�szSemanticVersion.debian_stringcCs�|jr+|jd}|j}|j}nMd}|jrS|jd}|j}n%d}|jrr|jd}nd}t|||�S)a�Return a decremented SemanticVersion.

        Decrementing versions doesn't make a lot of sense - this method only
        exists to support rendering of pre-release versions strings into
        serialisations (such as rpm) with no sort-before operator.

        The 9999 magic version component is from the spec on this - pbr-semver.

        :return: A new SemanticVersion object.
        r$i'r)rr
r	r)r�	new_patch�	new_minor�	new_majorrrr�	decrement�s	
		
	zSemanticVersion.decrementFcCs�|jr+|j}|jd}|j}nd}d}|jd}|rl|jd}d}d}d}n	|j}|r�|jd}d}d}d}d}n	|j}t|||||�S)a~Return an incremented SemanticVersion.

        The default behaviour is to perform a patch level increment. When
        incrementing a prerelease version, the patch level is not changed
        - the prerelease serial is changed (e.g. beta 0 -> beta 1).

        Incrementing non-pre-release versions will not introduce pre-release
        versions - except when doing a patch incremental to a pre-release
        version the new version will only consist of major/minor/patch.

        :param minor: Increment the minor version.
        :param major: Increment the major version.
        :return: A new SemanticVersion object.
        r$Nr)rr
rr
r	r)rrrZnew_prerelease_typeZnew_prereleaserWrXrYrrrrK
s.		


		
			zSemanticVersion.incrementr6cCs�|js|jr<|dkr<|j�j�g}d}n|j�g}|jrw|jd|||j|jf�|jr�|js�|j|�n
|jd�|jd�|j|j�djdd�|D��S)a1Construct a long string version of this semver.

        :param pre_separator: What separator to use between components
            that sort before rather than after. If None, use . and lower the
            version number of the component to preserve sorting. (Used for
            rpm support)
        Nr0z%s%s%s%srEr6css|]}t|�VqdS)N)�str)r2�srrr�	<genexpr>Psz0SemanticVersion._long_version.<locals>.<genexpr>)rrrZrSrHr
r<)rZ
pre_separatorZ	rc_marker�segmentsrrrrU7s 				

zSemanticVersion._long_versioncCs|jdd�S)zhReturn the full version of the package.

        This including suffixes indicating VCS status.
        r0rC)rU)rrrrr.RszSemanticVersion.release_stringcCs
|jd�S)aSReturn the version number to use when building an RPM package.

        This translates the PEP440/semver precedence rules into RPM version
        sorting operators. Because RPM has no sort-before operator (such as the
        ~ operator in dpkg),  we show all prerelease versions as being versions
        of the release before.
        N)rU)rrrr�
rpm_stringYszSemanticVersion.rpm_stringcCs+t|j|j|j|j|jd|�S)z~Return a development version of this semver.

        :param dev_count: The number of commits since the last release.
        r)rr	r
rrr
)rrrrrrLcszSemanticVersion.to_devcCs�|j|j|jg}|jr�dddddddd	dd
ddi}|j||jt|j�f�|j|jp�|j�nG|jr�|jd�|j|jd
�n|jd�|jd�t|�S)a�Present the version as a version_info tuple.

        For documentation on version_info tuples see the Python
        documentation for sys.version_info.

        Since semver and PEP-440 represent overlapping but not subsets of
        versions, we have to have some heuristic / mapping rules, and have
        extended the releaselevel field to have alphadev, betadev and
        candidatedev values. When they are present the dev count is used
        to provide the serial.
         - a/b/rc take precedence.
         - if there is no pre-release version the dev version is used.
         - serial is taken from the dev/a/b/c component.
         - final non-dev versions never get serials.
        r F�alphar!�betar"�	candidateTZalphadevZbetadevZcandidatedevrEr$�finalr)r F)r!F)�rcF)r T)r!T)rdT)	r	r
rrrH�boolrr
�tuple)rr^Ztype_maprrr�
version_tuplels"		


zSemanticVersion.version_tuple)�__name__�
__module__�__qualname__�__doc__rrrr'r)r*r+r,r-r/�classmethodrRrSrVrZrKrUr.r_rLrgrrrrr$s,	
k*
	rc@seZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e	Z
eZddd�ZdS)�VersionInfocCs(||_d|_d|_d|_dS)z�Object that understands versioning for a package

        :param package: name of the python package, such as glance, or
                        python-glanceclient
        N)�package�version�_cached_version�	_semantic)rrnrrrr�s			zVersionInfo.__init__cCs
|j�S)z1Make the VersionInfo object behave like a string.)rN)rrrr�__str__�szVersionInfo.__str__cCsd|j|j�fS)zInclude the name.zpbr.version.VersionInfo(%s:%s))rnrN)rrrrr/�szVersionInfo.__repr__cCsxy1tjj|j�}tj|�}|j}Wn7tjk
rjddlm}|j	|j�}YnXt
j|�S)aObtain a version from pkg_resources or setup-time logic if missing.

        This will try to get the version of the package from the pkg_resources
        record associated with the package, and if there is no such record
        falls back to the logic sdist would use.
        r)�	packaging)�
pkg_resourcesZRequirement�parsernZget_providerroZDistributionNotFoundZpbrrsZget_versionrrR)rZrequirementZproviderZ
result_stringrsrrr�_get_version_from_pkg_resources�s
z+VersionInfo._get_version_from_pkg_resourcescCs|j�j�S)zhReturn the full version of the package.

        This including suffixes indicating VCS status.
        )�semantic_versionr.)rrrrr.�szVersionInfo.release_stringcCs%|jdkr|j�|_|jS)z3Return the SemanticVersion object for this version.N)rqrv)rrrrrw�szVersionInfo.semantic_versioncCs|j�j�S)z3Return the short version minus any alpha/beta tags.)rwrS)rrrrrN�szVersionInfo.version_stringr6cCs)|js"d||j�f|_|jS)z�Return a cached version string.

        This will return a cached version string if one is already cached,
        irrespective of prefix. If none is cached, one will be created with
        prefix and then cached and returned.
        z%s%s)rprN)r�prefixrrr�cached_version_string�s	z!VersionInfo.cached_version_stringN)
rhrirjrrrr/rvr.rwrNZcanonical_version_stringZversion_string_with_vcsryrrrrrm�srm)	rkr=r:r%rtr�objectrrmrrrr�<module>s�n

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 95 B 0644
__init__.cpython-35.pyc File 95 B 0644
builddoc.cpython-35.opt-1.pyc File 6.58 KB 0644
builddoc.cpython-35.pyc File 6.58 KB 0644
core.cpython-35.opt-1.pyc File 2.94 KB 0644
core.cpython-35.pyc File 2.94 KB 0644
extra_files.cpython-35.opt-1.pyc File 620 B 0644
extra_files.cpython-35.pyc File 620 B 0644
find_package.cpython-35.opt-1.pyc File 721 B 0644
find_package.cpython-35.pyc File 721 B 0644
git.cpython-35.opt-1.pyc File 8.13 KB 0644
git.cpython-35.pyc File 8.13 KB 0644
options.cpython-35.opt-1.pyc File 412 B 0644
options.cpython-35.pyc File 412 B 0644
packaging.cpython-35.opt-1.pyc File 20.16 KB 0644
packaging.cpython-35.pyc File 20.16 KB 0644
pbr_json.cpython-35.opt-1.pyc File 632 B 0644
pbr_json.cpython-35.pyc File 632 B 0644
testr_command.cpython-35.opt-1.pyc File 4.63 KB 0644
testr_command.cpython-35.pyc File 4.63 KB 0644
util.cpython-35.opt-1.pyc File 15.43 KB 0644
util.cpython-35.pyc File 15.43 KB 0644
version.cpython-35.opt-1.pyc File 15.17 KB 0644
version.cpython-35.pyc File 15.17 KB 0644