ok

Mini Shell

Direktori : /opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyc

�
�2{Yc@srdZddlZddlZddlmZddddd	d
ddgZeje�Zde	fd
��YZ
defd��YZdefd��YZ
ejd�Zd�ZeZdefd��YZd�Zde
fd��YZejd�dfejd�dfejd�dfejd�dfejd�dfejd �dfejd!�d"fejd#�d$fejd%�d&fejd'�d(ff
Zejd)�dfejd*�dfejd+�d"fejd!�d"fejd,�dffZejd-�Zd.�Zd/�Zejd0ej�Zid1d26d1d36d4d56d1d66d7d86dd6dd"6Zd9�Zdefd:��YZde
fd;��YZ ejd<ej�Z!d=�Z"d>�Z#d	efd?��YZ$d
e
fd@��YZ%dAefdB��YZ&ie&eee�dC6e&ee dD��dE6e&e#e%e�dF6Z'e'dCe'dG<dH�Z(dS(Is~
Implementation of a flexible versioning scheme providing support for PEP-386,
distribute-compatible and semantic versioning.
i����Ni(tstring_typestNormalizedVersiontNormalizedMatchert
LegacyVersiont
LegacyMatchertSemanticVersiontSemanticMatchertUnsupportedVersionErrort
get_schemecBseZdZRS(sThis is an unsupported version.(t__name__t
__module__t__doc__(((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRstVersioncBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
ed��ZRS(
cCsZ|j�|_}|j|�|_}t|t�s>t�t|�dksVt�dS(Ni(tstript_stringtparset_partst
isinstancettupletAssertionErrortlen(tselftstparts((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt__init__scCstd��dS(Nsplease implement in a subclass(tNotImplementedError(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR$scCs5t|�t|�kr1td||f��ndS(Nscannot compare %r and %r(ttypet	TypeError(Rtother((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt_check_compatible'scCs|j|�|j|jkS(N(RR(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt__eq__+s
cCs|j|�S(N(R(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt__ne__/scCs|j|�|j|jkS(N(RR(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt__lt__2s
cCs|j|�p|j|�S(N(R R(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt__gt__6scCs|j|�p|j|�S(N(R R(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt__le__9scCs|j|�p|j|�S(N(R!R(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt__ge__<scCs
t|j�S(N(thashR(R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt__hash__@scCsd|jj|jfS(Ns%s('%s')(t	__class__R	R(R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt__repr__CscCs|jS(N(R(R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt__str__FscCstd��dS(NsPlease implement in subclasses.(R(R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt
is_prereleaseIs(R	R
RRRRRR R!R"R#R%R'R(tpropertyR)(((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRs												tMatchercBs�eZdZejd�Zejd�Zejd�Zid�d6d�d6d�d6d	�d
6d�d6d
�d6d�d6Z	d�Z
d�Zed��Z
d�Zd�Zd�Zd�Zd�Zd�ZRS(s^(\w[\s\w'.-]*)(\((.*)\))?s#^(<=|>=|<|>|!=|==|~=)?\s*([^\s,]+)$s
^\d+(\.\d+)*$cCs
||kS(N((tvtctp((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt<lambda>Wst<cCs
||kS(N((R,R-R.((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR/Xst>cCs||kp||kS(N((R,R-R.((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR/Yss<=cCs||kp||kS(N((R,R-R.((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR/Zss>=cCs
||kS(N((R,R-R.((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR/[ss==cCs||kp||kS(N((R,R-R.((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR/]ss~=cCs
||kS(N((R,R-R.((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR/^ss!=c
Cs�|jdkrtd��n|j�|_}|jj|�}|s\td|��n|jd�}|dj�|_|jj	�|_
g}|dr�g|djd�D]}|j�^q�}x�|D]�}|jj|�}|s
td||f��n|j�}|dp#d}|d	}|j
d
�r�|dkr^td
|��n|d t}}	|jj|�s�|j|�q�n|j|�t}}	|j|||	f�q�Wnt|�|_dS(NsPlease specify a version classs
Not valid: %rtiit,sInvalid %r in %rs~=is.*s==s!=s#'.*' not allowed for %r constraintsi����(s==s!=(t
version_classtNonet
ValueErrorR
Rtdist_retmatchtgroupstnametlowertkeytsplittcomp_retendswithtTruetnum_retFalsetappendRR(
RRtmR9tclistR-tconstraintstoptvntprefix((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRas:
,


cCs�t|t�r!|j|�}nx�|jD]�\}}}|jj|�}t|t�rmt||�}n|s�d||jjf}t	|��n||||�s+t
Sq+WtS(s�
        Check if the provided version matches the constraints.

        :param version: The version to match against this instance.
        :type version: Strring or :class:`Version` instance.
        s%r not implemented for %s(RRR4Rt
_operatorstgettgetattrR&R	RRBR@(Rtversiontoperatort
constraintRItftmsg((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR8�scCsJd}t|j�dkrF|jdddkrF|jdd}n|S(Niis==(R5RR(Rtresult((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt
exact_version�s,cCsGt|�t|�ks*|j|jkrCtd||f��ndS(Nscannot compare %s and %s(RR:R(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR�s*cCs/|j|�|j|jko.|j|jkS(N(RR<R(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR�s
cCs|j|�S(N(R(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR�scCst|j�t|j�S(N(R$R<R(R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR%�scCsd|jj|jfS(Ns%s(%r)(R&R	R(R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR'�scCs|jS(N(R(R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR(�sN(R	R
R5R4tretcompileR7R>RARJRR8R*RSRRRR%R'R((((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR+Ns*






	%						sQ^(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(-(\d+(\.\d+)?))?$cCs�|j�}tj|�}|s4td|��n|j�}td�|djd�D��}x0t|�dkr�|ddkr�|d }qfW|dd!}|d	d
!}|dd!}|d
}|dkr�d}n|dt	|d�f}|dkrd}n|dt	|d�f}|dkr:d}n|dt	|d�f}|dkrid}n.tg|jd�D]}t	|�^q|�}|s�|r�|r�d}q�d}n|s�d}n|s�d}n|||||fS(NsNot a valid version: %scss|]}t|�VqdS(N(tint(t.0R,((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pys	<genexpr>�sit.ii����iiiii	iitatzt_tfinal(NN((NN((NN(((RYi����(RZ(R[(sfinal(
R
tPEP426_VERSION_RER8RR9RR=RR5RV(RRDR9tnumstpretposttdevtlocal((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt_pep426_key�sB#%



				.
				cBsAeZdZd�Zedddddg�Zed��ZRS(sIA rational version.

    Good:
        1.2         # equivalent to "1.2.0"
        1.2.0
        1.2a1
        1.2.3a2
        1.2.3b1
        1.2.3c1
        1.2.3.4
        TODO: fill this out

    Bad:
        1           # mininum two numbers
        1.2a        # release level must have a release serial
        1.2.3b
    cCsQt|�}tj|�}|j�}td�|djd�D��|_|S(Ncss|]}t|�VqdS(N(RV(RWR,((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pys	<genexpr>	siRX(t_normalized_keyR]R8R9RR=t_release_clause(RRRRRDR9((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRs
&RYtbR-trcRacst�fd��jD��S(Nc3s(|]}|r|d�jkVqdS(iN(tPREREL_TAGS(RWtt(R(sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pys	<genexpr>s(tanyR(R((RsL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR)s(R	R
RRtsetRhR*R)(((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR�s	cCsUt|�}t|�}||kr(tS|j|�s;tSt|�}||dkS(NRX(tstrR@t
startswithRBR(txtytn((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt
_match_prefixscBs�eZeZidd6dd6dd6dd6dd	6d
d6dd
6Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�ZRS(t_match_compatibles~=t	_match_ltR0t	_match_gtR1t	_match_les<=t	_match_ges>=t	_match_eqs==t	_match_nes!=cCsx|r"d|ko|jd}n|jdo:|jd}|rn|jjdd�d}|j|�}n||fS(Nt-i����ii(RRR=R4(RRMRORItstrip_localR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt
_adjust_local,scCsj|j|||�\}}||kr+tS|j}djg|D]}t|�^qA�}t||�S(NRX(R{RBRetjoinRlRq(RRMRORItrelease_clausetitpfx((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRs:s	(cCsj|j|||�\}}||kr+tS|j}djg|D]}t|�^qA�}t||�S(NRX(R{RBReR|RlRq(RRMRORIR}R~R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRtBs	(cCs%|j|||�\}}||kS(N(R{(RRMRORI((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRuJscCs%|j|||�\}}||kS(N(R{(RRMRORI((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRvNscCsC|j|||�\}}|s0||k}nt||�}|S(N(R{Rq(RRMRORIRR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRwRs
cCsD|j|||�\}}|s0||k}nt||�}|S(N(R{Rq(RRMRORIRR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRxZs
cCs�|j|||�\}}||kr+tS||kr;tS|j}t|�dkrc|d }ndjg|D]}t|�^qp�}t||�S(Nii����RX(R{R@RBReRR|RlRq(RRMRORIR}R~R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRrbs	
((
R	R
RR4RJR{RsRtRuRvRwRxRr(((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRs"
							s[.+-]$R2s^[.](\d)s0.\1s^[.-]s
^\((.*)\)$s\1s^v(ersion)?\s*(\d+)s\2s^r(ev)?\s*(\d+)s[.]{2,}RXs\b(alfa|apha)\btalphas\b(pre-alpha|prealpha)\bs	pre.alphas	\(beta\)$tbetas
^[:~._+-]+s
[,*")([\]]s[~:+_ -]s\.$s
(\d+(\.\d+)*)c	Cs�|j�j�}x&tD]\}}|j||�}qW|sJd}ntj|�}|snd}|}n�|j�djd�}g|D]}t|�^q�}x#t	|�dkr�|j
d�q�Wt	|�dkr�||j�}nDdjg|dD]}t
|�^q�||j�}|d }djg|D]}t
|�^qB�}|j�}|r�x)tD]\}}|j||�}qvWn|s�|}n&d|kr�dnd}|||}t|�s�d}n|S(	s�
    Try to suggest a semantic form for a version for which
    _suggest_normalized_version couldn't come up with anything.
    s0.0.0iRXiRaRyt+N(R
R;t
_REPLACEMENTStsubt_NUMERIC_PREFIXR8R9R=RVRRCtendR|Rlt_SUFFIX_REPLACEMENTSt	is_semverR5(	RRRtpattreplRDRItsuffixR~tsep((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt_suggest_semantic_version�s:		:
(		cCs yt|�|SWntk
r%nX|j�}xSd2d3d4d5d6d7d8d9d:d;d<d=d>d?d@fD]\}}|j||�}qfWtjdd|�}tjdd|�}tjdd|�}tjdd|�}tjdd|�}|jd�r
|d }ntjd!d|�}tjd"d#|�}tjd$d%|�}tjd&d|�}tjd'd(|�}tjd)d(|�}tjd*d
|�}tjd+d,|�}tjd-d%|�}tjd.d/|�}tjd0d1|�}yt|�Wntk
rdA}nX|S(Bs�Suggest a normalized version close to the given version string.

    If you have a version string that isn't rational (i.e. NormalizedVersion
    doesn't like it) then you might be able to get an equivalent (or close)
    rational version from this function.

    This does a number of simple normalizations to the given string, based
    on observation of versions currently in use on PyPI. Given a dump of
    those version during PyCon 2009, 4287 of them:
    - 2312 (53.93%) match NormalizedVersion without change
      with the automatic suggestion
    - 3474 (81.04%) match when using this suggestion method

    @param s {str} An irrational version string.
    @returns A rational version string, or None, if couldn't determine one.
    s-alphaRYs-betaRfR�R�RgR-s-finalR2s-pres-releases.releases-stableR�RXR[t s.finalR\spre$tpre0sdev$tdev0s([abc]|rc)[\-\.](\d+)$s\1\2s[\-\.](dev)[\-\.]?r?(\d+)$s.\1\2s[.~]?([abc])\.?s\1R,is\b0+(\d+)(?!\d)s(\d+[abc])$s\g<1>0s\.?(dev-r|dev\.r)\.?(\d+)$s.dev\2s-(a|b|c)(\d+)$s[\.\-](dev|devel)$s.dev0s(?![\.\-])dev$s(final|stable)$s\.?(r|-|-r)\.?(\d+)$s.post\2s\.?(dev|git|bzr)\.?(\d+)$s\.?(pre|preview|-c)(\d+)$sc\g<2>sp(\d+)$s.post\1(s-alphaRY(s-betaRf(R�RY(R�Rf(srcR-(s-finalR2(s-preR-(s-releaseR2(s.releaseR2(s-stableR2(R�RX(R[RX(R�R2(s.finalR2(sfinalR2N(RdRR;treplaceRTR�RmR5(RtrstorigR�((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt_suggest_normalized_version�sH

		
	

s([a-z]+|\d+|[\.-])R-R_tpreviewsfinal-RyRgt@RacCs�d�}g}x�||�D]�}|jd�r�|dkrgx'|rc|ddkrc|j�q@Wnx'|r�|ddkr�|j�qjWn|j|�qWt|�S(NcSs�g}x�tj|j��D]j}tj||�}|rd|d koUdknrl|jd�}n
d|}|j|�qqW|jd�|S(Nt0it9it*s*final(t
_VERSION_PARTR=R;t_VERSION_REPLACERKtzfillRC(RRRR.((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt	get_parts4s 

R�s*finali����s*final-t00000000(RmtpopRCR(RR�RRR.((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt_legacy_key3s	
cBs eZd�Zed��ZRS(cCs
t|�S(N(R�(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRNscCsRt}xE|jD]:}t|t�r|jd�r|dkrt}PqqW|S(NR�s*final(RBRRRRmR@(RRRRn((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR)Qs(R	R
RR*R)(((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRMs	cBs?eZeZeej�Zded<ejd�Z	d�Z
RS(Rrs~=s^(\d+(\.\d+)*)cCs�||krtS|jjt|��}|sEtjd||�tS|j�d}d|krz|jdd�d}nt	||�S(NsACannot compute compatible match for version %s  and constraint %siRXi(
RBt
numeric_reR8RltloggertwarningR@R9trsplitRq(RRMRORIRDR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyRrds	
(R	R
RR4tdictR+RJRTRUR�Rr(((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR\s

sN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$cCs
tj|�S(N(t
_SEMVER_RER8(R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR�zsc
Cs�d�}t|�}|s*t|��n|j�}g|d D]}t|�^qA\}}}||dd�||dd�}}	|||f||	fS(NcSsi|dkr|f}nM|djd�}tg|D]'}|j�rV|jd�n|^q5�}|S(NiRXi(R5R=RtisdigitR�(RtabsentRRRR.((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt
make_tuples
:it|iR�(R�RR9RV(
RR�RDR9R~tmajortminortpatchR_tbuild((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt
_semantic_key~s	
,'cBs eZd�Zed��ZRS(cCs
t|�S(N(R�(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR�scCs|jdddkS(NiiR�(R(R((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR)�s(R	R
RR*R)(((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR�s	cBseZeZRS((R	R
RR4(((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR�st
VersionSchemecBs8eZdd�Zd�Zd�Zd�Zd�ZRS(cCs||_||_||_dS(N(R<tmatchert	suggester(RR<R�R�((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR�s		cCs8y|jj|�t}Wntk
r3t}nX|S(N(R�R4R@RRB(RRRR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pytis_valid_version�s


cCs5y|j|�t}Wntk
r0t}nX|S(N(R�R@RRB(RRRR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pytis_valid_matcher�s



cCs|jd|�S(s:
        Used for processing some metadata fields
        sdummy_name (%s)(R�(RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pytis_valid_constraint_list�scCs+|jdkrd}n|j|�}|S(N(R�R5(RRRR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pytsuggest�s	N(R	R
R5RR�R�R�R�(((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR��s
			t
normalizedcCs|S(N((RR((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR/�stlegacytsemantictdefaultcCs'|tkrtd|��nt|S(Nsunknown scheme name: %r(t_SCHEMESR6(R:((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyR�s()RtloggingRTtcompatRt__all__t	getLoggerR	R�R6RtobjectRR+RUR]RcRdRRqRR�R�R�R�R�tIR�R5R�R�RRR�R�R�RRR�R�R(((sL/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/version.pyt<module>	s~1j	/$	Q	.	r
					#	
	


Zerion Mini Shell 1.0