-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/share/python/debpython/
File Upload :
Current File : //usr/share/python/debpython/pydist.pyc

ó
([Uc@€soddlmZddlZddlZddlZddlmZmZmZddl	m
Z
ddlmZm
Z
ddlmZmZmZddlmZejeƒZejdƒZejd	ejƒZejd
ejƒZd„Zedd
dd„ƒZdd„Zd„Z d„Z!d„Z"d„Z#ejdƒZ$ejdƒZ%d„Z&d„Z'dS(iÿÿÿÿ(twith_statementN(texiststisdirtjoin(t	maketrans(tPIPEtPopen(tvreprtgetvertget_requested_versions(tmemoizes/.*?/usr/lib/python(\d.\d+)/(site|dist)-packagessÏ
    (?P<name>[A-Za-z][A-Za-z0-9_.\-]*)             # Python distribution name
    \s*
    (?P<vrange>(?:-?\d\.\d+(?:-(?:\d\.\d+)?)?)?) # version range
    \s*
    (?P<dependency>(?:[a-z][^;]*)?)              # Debian dependency
    (?:  # optional upstream version -> Debian version translator
        ;\s*
        (?P<standard>PEP386)?                    # PEP-386 mode
        \s*
        (?P<rules>(?:s|tr|y).*)?                 # translator rules
    )?
    s
    (?P<name>[A-Za-z][A-Za-z0-9_.]*)     # Python distribution name
    \s*
    (?P<enabled_extras>(?:\[[^\]]*\])?)  # ignored for now
    \s*
    (?:  # optional minimum/maximum version
        (?P<operator><=?|>=?|==|!=)
        \s*
        (?P<version>(\w|[-.])+)
    )?
    c
C€s‹t|ƒy}xo|D]g}|jdƒ}|jdƒs|rGqntj|ƒstjd|jddƒd|ƒtSqWWdQXt	S(s Check if pydist file looks good.s
t#s"invalid pydist data in file %s: %st/iiÿÿÿÿN(
topentstript
startswitht	PYDIST_REtmatchtlogterrortrsplittFalsetTrue(tfpathtfptline((s%/usr/share/python/debpython/pydist.pytvalidate=s
	s/usr/share/python/dist/sdebian/pydist-overridess/usr/share/python/dist_fallbackc

€s”t|ƒr|g}ng}tˆƒrS|j‡fd†tjˆƒDƒƒnt|ƒro|j|ƒni}x|D]}t|ƒü}xò|D]ê}|jdƒ}|jdƒs˜|rÉq˜nt	j
|ƒ}|s÷td||fƒ‚n|jƒ}t
|dƒ}	t|dƒ|d<|djƒ|d<|d	r_|d	jd
ƒ|d	<n
g|d	<|j|	gƒj|ƒq˜WWdQXq|W|S(s5Load iformation about installed Python distributions.c3€s|]}tˆ|ƒVqdS(N(R(t.0ti(tdname(s%/usr/share/python/debpython/pydist.pys	<genexpr>Tss
Rsinvalid pydist line: %s (in %s)tnametvrangetversionst
dependencytrulest;N(RRtextendtostlistdirtappendR
RRRtsearcht	Exceptiont	groupdictt	safe_nameR	tsplitt
setdefault(
Rtfnametfbnametto_checktresultRRRtdistR((Rs%/usr/share/python/debpython/pydist.pytloadKs4)



'cC€stjd||rt|ƒndƒt|tƒrCt|ƒ}ntjdƒj	|ƒj
ƒ\}}t|ƒ|}tƒ}t
j	|ƒ}|sµtjdƒtd|ƒ‚n|jƒ}|d}|j|jƒƒ}|r´xË|D]À}|r||jd|ƒkrqín|ds%dS|djdƒr@|dS|d	r¥|d
s^|dr¥|ddkr¥t|d	|d|d
ƒ}d|d|d|fS|dSqíWndtt|ƒƒ}	|réd|	t|ƒf}	n
d|	}	tjd|	ƒtd|	dtdtdtƒ}
|
jƒ\}}|
jdkrÇtƒ}
xC|jdƒD]2}|jƒswq_n|
j|jdƒdƒq_Wt|
ƒdkrºtj d|ƒqÚ|
j!ƒSntjd||ƒt"|ƒ}tjd||t|ƒƒ|S(Ns-trying to guess dependency for %s (python=%s)s([^!><= \[]+)(.*)s[please ask dh_python2 author to fix REQUIRES_RE or your upstream author to fix requires.txtsrequirement is not valid: %sRR R!t)tversiontstandardR"toperators==s
%s (%s %s)s'*/%s-?*\.egg-info's"%s | grep '/python%s/\|/pyshared/'s$%s | grep '/python2\../\|/pyshared/'sinvoking dpkg -S %ss/usr/bin/dpkg -S %stshelltstdouttstderris
t:is,more than one package name found for %s dists'dpkg -S did not find package for %s: %ss³Cannot find installed package that provides %s. Using %s as package name. Please add "%s correct_package_name" line to debian/pydist-overrides to override it if this is incorrect.(Ns==(#RtdebugRtNonet
isinstancet
basestringRtretcompileRtgroupsR+R3tREQUIRES_REtinfoR)R*tgettlowertendswitht
_translatet	ci_regexpRRRtcommunicatet
returncodetsetR,RtaddtlenRtpoptsensible_pname(treqR5Rtresttdatatreq_dtdetailstitemtvtquerytprocessR9R:R1Rtpname((s%/usr/share/python/debpython/pydist.pytguess_dependencynsd	$	





	
	cC€stj|ƒ}|r'|jdƒ}nd}g}t}}g}t|dƒñ}g|jƒD]}|jƒ^qb}	xÂ|	D]º}
|
s|
jdƒr°|j	|
ƒqn|
jdƒrÈt
}n|rá|j	|
ƒqnt|
|ƒ}|r.|j	|ƒd|
jƒkrt
}q;|j	|
ƒq|j	|
ƒqWWdQX|r}t|dƒ}|j
d„|DƒƒWdQXn|S(NitrRt[t
setuptoolstwcs€s|]}|dVqdS(s
N((RR((s%/usr/share/python/debpython/pydist.pys	<genexpr>Øs(t
PUBLIC_DIR_RERtgroupR=RR
t	readlinesRRR'RR[RFt
writelines(R.t
public_dirtverR1tmodifiedtoptional_sectiont	processedRRtlinesRR!((s%/usr/share/python/debpython/pydist.pytparse_pydep¶s:
%

	

	 cC€stjdƒjd|ƒjƒS(sEmulate distribute's safe_name.s[^A-Za-z0-9.]+t_(R@RAtsubRF(R((s%/usr/share/python/debpython/pydist.pyR+ÜscC€sBt|ƒjddƒ}|jdƒr4|d}nd|jƒS(s(Guess Debian package name from Egg name.Rkt-spython-is	python-%s(R+treplaceRRF(tegg_name((s%/usr/share/python/debpython/pydist.pyRPás
cC€sdjd„|jƒDƒƒS(s'Return case insensitive dpkg -S regexp.tcs€s7|]-}|jƒr+d|jƒ|fn|VqdS(s[%s%s]N(tisalphatupper(RR((s%/usr/share/python/debpython/pydist.pys	<genexpr>ës(RRF(R((s%/usr/share/python/debpython/pydist.pyRIéss[-.]?(alpha|beta|rc|dev|a|b|c)s\$(\d+)cC€stjd|ƒS(scConvert Perl RE patterns used in uscan to Python's

    >>> print _pl2py('foo$3')
    foo\g<3>
    s\\g<\1>(tGROUP_RERl(tpattern((s%/usr/share/python/debpython/pydist.pyt_pl2pyòsc	C€scx;|D]3}|jdƒru|jdƒr1dnd}||dj||ƒ}|jt|d|dƒƒ}q|jdƒr*|dj|dƒ}tj|dƒ}d}|dr|d}d|krÝd}nd|krtj|dtjƒ}qn|jt|dƒ||ƒ}qt	j
d	|ƒqW|d
kr_tjd|ƒ}n|S(
s>Translate Python version into Debian one.

    >>> _translate('1.C2betac', ['s/c//gi'], None)
    '1.2beta'
    >>> _translate('5-fooa1.2beta3-fooD',
    ...     ['s/^/1:/', 's/-foo//g', 's:([A-Z]):+$1:'], 'PEP386')
    '1:5~a1.2~beta3+D'
    >>> _translate('x.y.x.z', ['tr/xy/ab/', 'y,z,Z,'], None)
    'a.b.a.Z'
    ttrtyiiitstgRsunknown rule ignored: %stPEP386s~\g<1>(RvRw(RR,t	translateRR@RAtIRlRuRtwarnt
PRE_VER_RE(	R5R"R6truletposttmpRttcounttflags((s%/usr/share/python/debpython/pydist.pyRHûs(
#

	"((t
__future__RtloggingR%R@tos.pathRRRtstringRt
subprocessRRtdebpython.versionRRR	tdebpython.toolsR
t	getLoggert__name__RRAR`tVERBOSERRCRR3R=R[RjR+RPRIR~RsRuRH(((s%/usr/share/python/debpython/pydist.pyt<module>s6
	!H	&					

Copyright © 2017 || Recoded By Mr.Bumblebee