Ñò îaNc@sddkZddkZddkZddkZddklZdZdZdZdZ dZ dZ dZ dZ d Zd efd „ƒYZd efd „ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdS(iÿÿÿÿN(tizipii2idieifiÈi,t VersionErrorcBseZdZd„ZRS(s,Base exception class for all version errors.cGsti||ŒdS(N(t Exceptiont__init__(tselftargs((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR2s(t__name__t __module__t__doc__R(((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR/stIllegalDotSequencecBseZdZRS(s=Used to indicate that the specified DotSequence is not valid.(RRR(((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR 6st DotSequencecBsheZdZeiƒZed„ƒZd„Zd„Z d„Z d„Z d„Z d„Z d„ZRS( sÅA DotSequence is the typical "x.y.z" string used in software versioning. We define the "major release" value and the "minor release" value as the first two numbers in the sequence.cCsYt|ƒ}|ddjo td‚n|djo|ddjo td‚n|S(Nit-sNegative numbert0sZero padded number(tintt ValueError(telemtx((s1/usr/lib/python2.6/vendor-packages/pkg/version.pytdotsequence_valEs    cCsAtii|ƒ}|djoti|ƒ|i|<}n|S(N(R t_DotSequence__dotseq_pooltgettNonetlistt__new__(tclst dotstringtds((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyRPs c CsŠt|ƒdjodSy)ti|tti|idƒƒƒWntj ot|ƒ‚nXt|ƒdjotdƒ‚ndS(Nit.sEmpty DotSequence( tlenRRtmapR RtsplitRR (RR((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyRWs  cCsditt|ƒƒS(NR(tjoinRtstr(R((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt__str__fscCstt|ƒƒS(N(thashttuple(R((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt__hash__iscCsTt|ƒt|ƒjotSx/t||ƒD]\}}||jotSq.WtS(s¬Return true if self is a "subsequence" of other, meaning that other and self have identical components, up to the length of self's sequence.(RtFalseRtTrue(Rtothertatb((s1/usr/lib/python2.6/vendor-packages/pkg/version.pytis_subsequencels   cCs|d|djS(s1 Test if DotSequences have the same major number i((RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt is_same_majoryscCs'|d|djo|d|djS(s8 Test if DotSequences have the same major and minor num ii((RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt is_same_minor}s(RRRtweakreftWeakValueDictionaryRt staticmethodRRRR R#R)R*R+(((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR 9s      tMatchingDotSequencecBsheZdZeiƒZed„ƒZd„Zd„Z d„Z d„Z d„Z d„Z d„ZRS( sŒA subclass of DotSequence with (much) weaker rules about its format. This is intended to accept user input with wildcard characters.cCs|djo|Sti|ƒS(Nt*(R R(R((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyRs cCsGtii|dƒ}|dj o|Sti|ƒ}||i|<|S(N(R/t*_MatchingDotSequence__matching_dotseq_poolRRRR(RRR((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR–s    c Csry)ti|t|i|idƒƒƒWntj ot|ƒ‚nXt|ƒdjotdƒ‚ndS(NRisEmpty MatchingDotSequence(RRRRRRR R(RR((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR s  cCst|tƒptSt|ƒ}t|ƒ}xÎtt||ƒƒD]·}y9||||jo d||||fjotSWqCtj oi||djo d|d||fjotS||djo d|||dfjotSqCXqCWtS(NR0iiÿÿÿÿ(t isinstanceR R%Rtrangetmaxt IndexErrorR$(RR&tlstloti((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt__ne__«s$   cCst|tƒptSt|ƒ}t|ƒ}xÎtt||ƒƒD]·}y9||||jo d||||fjotSWqCtj oi||djo d|d||fjotS||djo d|||dfjotSqCXqCWtS(NR0iiÿÿÿÿ(R2R R$RR3R4R5R%(RR&R6R7R8((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt__eq__¿s$   cCst|ƒdjpt|ƒdjotSt|ƒt|ƒjotSx/t||ƒD]\}}||jotSqYWtS(sÄReturn true if self is a "subsequence" of other, meaning that other and self have identical components, up to the length of self's sequence or self or other is '*'.R0(RR%RR$R(RR&R'R(((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR)Ós&   cCs4|ddjp#|ddjp|d|djS(sQTest if DotSequences have the same major number, or major is '*'.iR0((RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR*ãscCsk|ddjpZ|ddjpI|ddjp8|ddjp'|d|djo|d|djS(s8 Test if DotSequences have the same major and minor num.iR0i((RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR+ès3(RRRR,R-R1R.RRRR9R:R)R*R+(((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR/‚s     tIllegalVersioncBseZdZRS(s@Used to indicate that the specified version string is not valid.(RRR(((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR;ïstVersioncBsÝeZdZddddgZd„Zedd„ƒZedd„ƒZd„Z d „Z d „Z d „Z e i iƒd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zed„ƒZRS(sÔVersion format is release[,build_release]-branch:datetime, which we decompose into three DotSequences and a date string. Time representation is in the ISO8601-compliant form "YYYYMMDDTHHMMSSZ", referring to the UTC time associated with the version. The release and branch DotSequences are interpreted normally, where v1 < v2 implies that v2 is a later release or branch. The build_release DotSequence records the system on which the package binaries were constructed. Interpretation of the build_release by the client is that, in the case b1 < b2, a b1 package can be run on either b1 or b2 systems,while a b2 package can only be run on a b2 system.treleasetbrancht build_releasettimestrc CsŽ|p td‚n|idƒ}|djo||d}n d}d}|idƒ}|djo||d|!}n |}d}|idƒ}|djo||d|!}n |}d}|djo td‚ny–t|| ƒ|_|dj ot|ƒ|_n d|_|dj ot|ƒ|_n7|djotd ||fƒ‚nt|ƒ|_Wn%tj o} td | ƒ‚nX|dj oÔt|ƒd jp"|d d jp|ddjo td‚nyft |dd !ƒ} t |dd!ƒ} t i | d| dd| d| d| dd| dƒWnt j otd‚nX||_ n d|_ dS(NsVersion cannot be emptyt:iÿÿÿÿiR t,is"Versions must have a release values:No build version provided in Version constructor: (%s, %s)sBad Version: %siitTitZsTime must be ISO8601 format.i i'id( R;tfindRR R=R>R?R RR tdatetimeRR@( Rtversion_stringt build_stringttimeidxR@t branchidxR>tbuildidxtbuildtetdateintttimeint((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyRsj           $      cCs t|ƒS(sReturns the serialized state of this object in a format that that can be easily stored using JSON, pickle, etc.(R(tobjtje_state((s1/usr/lib/python2.6/vendor-packages/pkg/version.pytgetstate_scCs t|dƒS(s`Allocate a new object using previously serialized state obtained via getstate().N(R<R(tstatetjd_state((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt fromstateescCs|i|jotStS(s.target is a DotSequence for the target system.(R?R%R$(Rttarget((s1/usr/lib/python2.6/vendor-packages/pkg/version.pytcompatible_with_buildkscCsht|iƒdt|iƒ}|io|dt|iƒ7}n|io|d|i7}n|S(NRBR RA(RR=R?R>R@(Rtoutstr((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR qs    cCsd|t|ƒfS(Ns(tid(R((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt__repr__yscCs8d}|idj od|i}nd|i|fS(Nts-%ss%s%s(R>RR=(Rt branch_str((s1/usr/lib/python2.6/vendor-packages/pkg/version.pytget_short_version|scCs`t|ƒtijpt‚|iƒdjp|iƒdjpt‚|idƒ|_dS(NtUTCs%Y%m%dT%H%M%SZ(ttypeRFtAssertionErrorttznameRtstrftimeR@(Rt timestamp((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt set_timestamp‚s-cCs=|ipdSti|idƒ}tiiti|ƒƒS(Ns%Y%m%dT%H%M%SZ(R@RttimetstrptimeRFtutcfromtimestamptcalendarttimegm(Rtt((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt get_timestamp‡s cCsWt|tƒptS|i|ijo+|i|ijo|i|ijotStS(N(R2R<R%R=R>R@R$(RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR9scCsWt|tƒptS|i|ijo+|i|ijo|i|ijotStS(N(R2R<R$R=R>R@R%(RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR:—scCs…t|tƒptS|i|ijotS|i|ijotS|i|ijotS|i|ijotS|i|ijS(s Returns True if 'self' comes before 'other', and vice versa. If exactly one of the release values of the versions is None, then that version is less than the other. The same applies to the branch and timestamp components. (R2R<R$R=R%R>R@(RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt__lt__¡scCs…t|tƒptS|i|ijotS|i|ijotS|i|ijotS|i|ijotS|i|ijS(sReturns True if 'self' comes after 'other', and vice versa. If exactly one of the release values of the versions is None, then that version is less than the other. The same applies to the branch and timestamp components. (R2R<R%R=R$R>R@(RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt__gt__·scCsX||jodS||jodS|i|ijodS|i|ijodSdS(Niÿÿÿÿii(R?(RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt__cmp__Ís  cCs2|iot|iƒSt|i|ifƒSdS(N(R@R!R=R>(R((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR#Ùs cCs|djp |tjo ||jS|tjo-t|ƒtjo|io)|io|ii|iƒptSn&|iot|iƒdjotS|i o)|i o|i i|i ƒptSn&|i ot|i ƒdjotS|i o6|i o,|i |i jp |i djptSn&|i ot|i ƒdjotSt S|tjoÈ|io)|io|ii|iƒptSn|iotS|i o)|i o|i i|i ƒptSn|i otS|i o&|i o|i |i jotSn|i otSt S|t jo|ii|iƒS|t jo|ii|iƒS|tjo|ii|iƒS|tjo|i i|i ƒS|tjo|i i|i ƒS|tjo|i i|i ƒStd‚dS(s;Evaluate true if self is a successor version to other. The loosest constraint is CONSTRAINT_NONE (None is treated equivalently, which is a simple test for self > other. As we proceed through the policies we get stricter, depending on the selected constraint. Slightly less loose is CONSTRAINT_AUTO. In this case, if any of the release, branch, or timestamp components is None, it acts as a "don't care" value -- a versioned component always succeeds None. For CONSTRAINT_RELEASE, self is a successor to other if all of the components of other's release match, and there are later components of self's version. The branch and datetime components are ignored. For CONSTRAINT_RELEASE_MAJOR and CONSTRAINT_RELEASE_MINOR, other is effectively truncated to [other[0]] and [other[0], other[1]] prior to being treated as for CONSTRAINT_RELEASE. Similarly for CONSTRAINT_BRANCH, the release fields of other and self are expected to be identical, and then the branches are compared as releases were for the CONSTRAINT_RELEASE* policies. R0sconstraint has unknown valueN(RtCONSTRAINT_NONEtCONSTRAINT_AUTOR_tMatchingVersionR=R)R$RR>R@R%tCONSTRAINT_RELEASEtCONSTRAINT_RELEASE_MAJORR*tCONSTRAINT_RELEASE_MINORR+tCONSTRAINT_BRANCHtCONSTRAINT_BRANCH_MAJORtCONSTRAINT_BRANCH_MINORR(RR&t constraint((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyt is_successorâsj                         c Cs|idƒ}|djo||d}n d}d}|idƒ}|djo||d|!}n |}d}|idƒ}|djo||d|!}n |}d}|| }d} |dj o |} n|dj o|d|} n|} || ||f| fS(s¶Takes an assumed valid version string and splits it into its components as a tuple of the form ((release, build_release, branch, timestr), short_ver).RAiÿÿÿÿiR RBR[N(RER( RtverRIR@RJR>RKRLR=R?t short_ver((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyRAs.       N(RRRt __slots__RR.RRRRURWR RZR]RFtutcnowRdRkR9R:RlRmRnR#Ryt classmethodR(((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR<òs*  _        _RqcBsbeZdZddgZd„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z RS( sAn alternative for Version with (much) weaker rules about its format. This is intended to accept user input with globbing characters.t match_latestt __originalc CsÎ|djpt|ƒ o td‚n|djot|_d}n t|_|i|ƒ\\}}}}}|p |}ny¡xšd|ffd|dffd|dffd|dfffD]Y\}} xJ| D]B} | pqÙn|djot| ƒ} nt||| ƒPqÙWqÆWWn%t j o} td| ƒ‚nXt |ƒ} |dj o| d t |ƒ7} n|dj o| d t |ƒ7} n|dj o| d |7} n| |_ dS( NsVersion cannot be emptytlatestR0R=R?R>R@sBad Version: %sRBR RA( RRR;R%RR$RR/tsetattrR Rt_MatchingVersion__original( RRGRHR=R?R>R@tignoredtattrtvalstvalRMRX((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyRssD     !         cCs|iodS|iS(NR(RRƒ(R((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR ¨s cCs"|idjodSti|ƒS(NR0(R@R<Rk(R((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyRk­scCsƒt|tƒptS|i|ijoW|i|ijoD|i|ijo1|i|ijpd|i|ifjotStS(NR0(R2R<R%R=R?R>R@R$(RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR9²scCsƒt|tƒptS|i|ijoW|i|ijoD|i|ijo1|i|ijpd|i|ifjotStS(NR0(R2R<R$R=R?R>R@R%(RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR:¾scCsmt|tƒptSt|iƒdjot|iƒdjotS|i|ijotS|i|ijotSt|iƒdjot|iƒdjotS|i|ijotS|i|ijotSt|iƒdjot|iƒdjotS|i|ijotS|i|ijotS|idjo|idjotS|i|ijS(s'Returns True if 'self' comes before 'other', and vice versa. If exactly one of the release values of the versions is None or "*", then that version is less than the other. The same applies to the branch and timestamp components. R0( R2R<R$RR=R%R?R>R@(RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyRlÊs0,, cCsmt|tƒptSt|iƒdjot|iƒdjotS|i|ijotS|i|ijotSt|iƒdjot|iƒdjotS|i|ijotS|i|ijotSt|iƒdjot|iƒdjotS|i|ijotS|i|ijotS|idjo|idjotS|i|ijS(s&Returns True if 'self' comes after 'other', and vice versa. If exactly one of the release values of the versions is None or "*", then that version is less than the other. The same applies to the branch and timestamp components. R0( R2R<R%RR=R$R?R>R@(RR&((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyRmïs0,, cCsB|io|idjot|iƒSt|i|ifƒSdS(NR0(R@R!R=R>(R((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyR#s( RRRR|RR RkR9R:RlRmR#(((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyRqls  5   % %(RhRFReR,t itertoolsRRoRpRrRsRtRuRvRwtCONSTRAINT_SEQUENCERRR RR R/R;tobjectR<Rq(((s1/usr/lib/python2.6/vendor-packages/pkg/version.pyts*    Imÿ{