MOON
Server: Apache
System: Linux vps.erhabenn.com.br 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User: machen (1008)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyc
�
d�bc@s9ddlmZddlZdejfd��YZdS(i����(tversionNtFlexibleVersionc	Bs"eZdZd"dd#d�ZdZdZdZd	Zd
j	dedd
j
eej
d$���Zed��Zed��Zed��Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d �Z!d!�Z"RS(%s�
    A more flexible implementation of distutils.version.StrictVersion

    The implementation allows to specify:
    - an arbitrary number of version numbers:
        not only '1.2.3' , but also '1.2.3.4.5'
    - the separator between version numbers:
        '1-2-3' is allowed when '-' is specified as separator
    - a flexible pre-release separator:
        '1.2.3.alpha1', '1.2.3-alpha1', and '1.2.3alpha1' are considered equivalent
    - an arbitrary ordering of pre-release tags:
        1.1alpha3 < 1.1beta2 < 1.1rc1 < 1.1
        when ["alpha", "beta", "rc"] is specified as pre-release tag list

    Inspiration from this discussion at StackOverflow:
        http://stackoverflow.com/questions/12255554/sort-versions-in-python
    t.talphatbetatrccCs�tjj|�|dkr%d}n|dkr:d}n||_d|_|dk	rdt|�nd|_|j�d|_	d|_|r�|j
t|��ndS(NRt((((RtVersiont__init__tNonetsept
prerel_septtupletprerel_tagst_compile_patternt
prereleaset_parsetstr(tselftvstringR
R
((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyR+s				!
		RRttagttag_nums(?P<{pn}>{sep})?tpnR
t|t-cCs$t|j�dkr |jdSdS(Ni(tlenR(R((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pytmajorHscCs$t|j�dkr |jdSdS(Nii(RR(R((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pytminorLscCs$t|j�dkr |jdSdS(Nii(RR(R((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pytpatchPscCs�|jj|�}|s0tdj|���nd|_d|_|j|j�|_	|j|j
�}|j|j�}|dk	r�|dk	r�|t|�r�t
|�ndf|_nttt
|jj|j|j����|_dS(NsInvalid version number '{0}'((t
version_retmatcht
ValueErrortformatR	RRtgroupt_nn_prerel_sepRt_nn_prerel_tagt_nn_prerel_numRtintRtmaptsep_retsplitt_nn_version(RRtmRR((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyRTs		*0cCs_t|j�}|dc|7<|j||j|j|j�}td|d|jd|j�S(Ni����RR
R
(tlistRt	_assembleR
RRRR
(Rt	incrementRR((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyt__add__fs!cCs�t|j�}|ddkr7tdj|���n|dc|8<|j||j|j|j�}td|d|jd|j	�S(Ni����is:Cannot decrement final numeric component of {0} below zeroRR
R
(
R+RtArithmeticErrorR R,R
RRRR
(Rt	decrementRR((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyt__sub__ls	!c	Cs4djd|jjdt|�d|jd|j�S(Ns+{cls} ('{vstring}', '{sep}', {prerel_tags})tclsRR
R
(R t	__class__t__name__RR
R
(R((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyt__repr__us
		cCs"|j|j|j|j|j�S(N(R,RR
RR(R((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyt__str__}scCs|j|�S(N(t__lt__(Rtthat((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyt__ge__�scCs|j|�o|j|�S(N(R7t__eq__(RR8((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyt__gt__�scCs|j|�p|j|�S(N(R7R:(RR8((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyt__le__�scCs�|j|�\}}||ks?|jdkrI|jdkrI||kS|jdk	rk|jdkrktS|jdkr�|jdk	r�tS|j|jd}|j|jd}||kr�|jd|jdkS||kS(Nii(t_ensure_compatibleRR	tTruetFalsetprerel_tags_set(RR8tthis_versiontthat_versiont
this_indext
that_index((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyR7�s
cCs|j|�S(N(R:(RR8((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyt__ne__�scCs?|j|�\}}||kr%tS|j|jkr;tStS(N(R=R?RR>(RR8RARB((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyR:�scCs�|j|jks0t|j�t|j�kr4tSx;tt|j��D]$}|j||j|krJtSqJW|jr�|j|jkStS(N(R
RRR?trangeR
R>(RR8ti((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pytmatches�s0	cCsy|jtt|��}|dk	ru|dk	r=||7}n||d7}|ddk	ru|t|d�7}qun|S(Nii(tjoinR&RR	(RRR
RRts((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyR,�s
c	Cs�|j|j�\}|_|jr�djd�|jD��}tt|jtt|j����|_	dj
d|jd|d|jd|j
�}nd}d	j
d
|jd|d|�}tj|�|_dS(
NRcss|]}tj|�VqdS(N(tretescape(t.0R((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pys	<genexpr>�ss.(?:{prerel_sep}(?P<{tn}>{tags})(?P<{nn}>\d*))?RttagsttntnnRs&^(?P<{vn}>\d+(?:(?:{sep}\d+)*)?){rel}$tvnR
trel(t_compile_separatorR
R'R
RItdicttzipRFRR@R t_re_prerel_sepR#R$R)RKtcompileR(RR
RNt
release_reR((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyR�s 	*						cCsD|dkrdtjd�fStj|�tjtj|��fS(NR(R	RKRWRL(RR
((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyRS�scCs�|j|jks$|j|jkr3td��nt|j�}t|j�}x)t|�t|�kr~|jd�qVWx)t|�t|�kr�|jd�q�W||fS(s�
        Ensures the instances have the same structure and, if so, returns length compatible
        version lists (so that x.y.0.0 is equivalent to x.y).
        s5Unable to compare: versions have different structuresi(R
R
RR+RRtappend(RR8RARB((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyR=�s$N(RRsrc(RR(#R4t
__module__t__doc__R	RR)R"R#R$R RIR&RKRLRVtpropertyRRRRR.R1R5R6R9R;R<R7RER:RHR,RRSR=(((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyRs8															
		(t	distutilsRRKRR(((sQ/usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/flexible_version.pyt<module>s