-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /proc/thread-self/root/proc/thread-self/root/usr/share/python/debpython/
File Upload :
Current File : //proc/thread-self/root/proc/thread-self/root/usr/share/python/debpython/tools.pyc

ó
([Uc@€s¦ddlmZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
ddlmZddlmZmZddlmZmZmZejeƒZejd	ƒZejd
ƒZejdƒZejdeejƒZejd
eejƒZ de"d„Z#d„Z$d„Z%dd„Z&d„Z'd„Z(d„Z)de*fd„ƒYZ+d„Z,d„Z-dS(iÿÿÿÿ(twith_statementN(tdumps(tglob(texiststisdirtjointsplit(trmtree(tPIPEtPopen(t
RANGE_PATTERNtgetvertget_requested_versionss/(.*?)(-py\d\.\d(?:-[^.]*)?)?(\.egg-info|\.pth)$sA^#!\s*(.*?/bin/.*?)(python(2\.\d+)?(?:-dbg)?)(?:\s(.*))?[$\r\n].*sNEEDED.*libpython(\d\.\d)s¸
    (?P<pattern>.+?)  # file pattern
    (?:\s+  # optional Python module name:
    (?P<module>[A-Za-z][A-Za-z0-9_.]*)?
    )?
    \s*  # optional version range:
    (?P<vrange>%s)?$
s^
    (?P<pattern>.+?)  # file pattern
    \s*  # optional version range:
    (?P<vrange>%s)?$
cC€s„t|tƒr1td„|jdƒDƒƒ}n|d	krJd|}n
d|}|rgd|}n|r€d||f}n|S(
sàReturn path to site-packages directory.

    >>> sitedir((2, 5))
    '/usr/lib/python2.5/site-packages/'
    >>> sitedir((2, 7), 'python-foo', True)
    'debian/python-foo/usr/lib/debug/usr/lib/python2.7/dist-packages/'
    cs€s|]}t|ƒVqdS(N(tint(t.0ti((s$/usr/share/python/debpython/tools.pys	<genexpr>>st.iis#/usr/lib/python%d.%d/dist-packages/s#/usr/lib/python%d.%d/site-packages/s/usr/lib/debug%ssdebian/%s%s(ii(t
isinstancet
basestringttupleR(tversiontpackagetgdbtpath((s$/usr/share/python/debpython/tools.pytsitedir5s"


cC€si|jdƒ}|jdƒ}x&|d|dkrF|d=|d=q!Wdjdgt|ƒd|ƒS(s~Return relative path.

    >>> relpath('/usr/share/python-foo/foo.py', '/usr/bin/foo', )
    '../share/python-foo/foo.py'
    t/is..i(RRtlen(ttargettlinktttl((s$/usr/share/python/debpython/tools.pytrelpathMs
cC€stjt||ƒ|ƒS(sCreate relative symlink.(tostsymlinkR(RR((s$/usr/share/python/debpython/tools.pytrelative_symlinkZsc	C€sKy?t|ƒ}|jƒ}WdQX|s>tjd|ƒdSWn"tk
rctjd|ƒtSXtj	|dƒ}|sdS|sí|j
ƒ\}}}}|dkr¸d|}n|dkrÍd}n|rí|rí|d	|7}qín|rGtjd
||dƒt|dƒ)}|jd|ƒ|j
|d
ƒWdQXntS(smNormalize file's shebang.

    :param replacement: new shebang command (path to interpreter and options)
    Ns$fix_shebang: ignoring empty file: %sscannot open %sis/usr/bins/usr/bin/%stpython2s/usr/bin/pythons %ssreplacing shebang in %s (%s)tws#! %s
i(topent	readlinestlogtdebugtNonetIOErrorterrortFalset
SHEBANG_REtmatchtgroupstinfotwritet
writelinestTrue(	tfpathtreplacementtfptfcontentR.RtinterpreterRtargv((s$/usr/share/python/debpython/tools.pytfix_shebang_s4

	cC€s¸yt|ƒ~}|jdƒ}tj|ƒ}|s:dS|jƒ}|dd!dkr‰|dr{|dt|dƒfS|ddfSWdQXWn!tk
r³tj	d|ƒnXdS(spCheck file's shebang.

    :rtype: tuple
    :returns: pair of Python interpreter string and Python version
    i iiiNscannot open %s(NN(
R%treadR-R.R)R/RR*R'R+(R4R6tdataR.tres((s$/usr/share/python/debpython/tools.pyt
shebang2pyverƒs

cC€sXd|}t|dtdtƒ}tj|jjƒƒ}|rTt|jƒdƒSdS(shReturn libpython version file is linked to or None.

    :rtype: tuple
    :returns: Python version
    sreadelf -Wd '%s'tstdouttshelliN(	R	RR3tSHAREDLIB_REtsearchR?R;RR/(R4tcmdtprocessR.((s$/usr/share/python/debpython/tools.pytso2pyver˜s

cC€sGtj|ƒ}|rC|jdƒdk	rCdj|jddƒƒS|S(sRemove Python version and platform name from Egg files/dirs.

    >>> clean_egg_name('python_pipeline-0.1.3_py3k-py3.1.egg-info')
    'python_pipeline-0.1.3_py3k.egg-info'
    >>> clean_egg_name('Foo-1.2-py2.7-linux-x86_64.egg-info')
    'Foo-1.2.egg-info'
    itiiN(t
EGGnPTH_RER.tgroupR)R(tnameR.((s$/usr/share/python/debpython/tools.pytclean_egg_name¦stmemoizecB€seZd„Zd„ZRS(cC€s||_i|_dS(N(tfunctcache(tselfRL((s$/usr/share/python/debpython/tools.pyt__init__µs	cO€sHt||fƒ}||jkr=|j||Ž|j|<n|j|S(N(RRMRL(RNtargstkwargstkey((s$/usr/share/python/debpython/tools.pyt__call__¹s(t__name__t
__module__RORS(((s$/usr/share/python/debpython/tools.pyRK´s	cC€s·t}d|}t|ƒs |St|ƒ}x„tj|ddƒD]m}|sB|jdƒrdqBntj|ƒ}|s˜t}t	j
d||ƒqBn|jƒ}|drË|djddƒ|d<n|t|d	ƒ@}|sþt	j
d
||ƒqBnt|dƒ}|s7t}t	jd||dƒqBnxu|D]m}	|	jd
ƒ}	|dr}t|dt|	ƒdƒ}
n"|	jdƒr™|	d}
n|	}
x	|D]}tt||ƒ|
ƒ}t|ƒd}
t|
ƒsytj|
ƒWqtk
rt	jd|
ƒtSXnt|ƒrfytj|ƒWqftk
rbt}t	jd|ƒq¦qfXnytj|	|ƒWq¦tk
r¦t}t	jd|	|
ƒq¦Xq¦Wq>WqBW|S(sDInstall local files listed in pkg.pyinstall files as public modules.s./debian/%s.pyinstalltencodingsutf-8t#s#%s.pyinstall: unrecognized line: %stmoduleRRtvranges.%s.pyinstall: no matching versions for line %stpatterns %s.pyinstall: file not found: %ss/.isdebian/iiscannot create %s directoryscannot replace %s filescannot copy %s file to %s(R3RRtcodecsR%t
startswitht
INSTALL_RER.R,R'twarnt	groupdicttreplaceR(RR+tlstripRRRR tmakedirst	ExceptiontremoveR(RRYtstatustsrcfpathtversionstlinetdetailstmyverstfilesR4tdstnameRtdstfpathtdstdir((s$/usr/share/python/debpython/tools.pyt	pyinstallÀsr
	

	
	

 





#c	C€sÊt}d|}t|ƒs |St|ƒ}x—tj|ddƒD]€}|sB|jdƒrdqBntj|ƒ}|s˜t}t	j
d||ƒqBn|jƒ}|t|dƒ@}|s×t	jd||ƒqBnxè|D]à}t
t||ƒ|dƒ}	|	s't	jd	|||dƒqÞnx”|	D]Œ}
t|
ƒrzyt|
ƒWqºtk
rv}t}t	j|ƒqºXq.ytj|
ƒWq.ttfk
r¹}t}t	j|ƒq.Xq.WqÞWqBW|S(
s2Remove public modules listed in pkg.pyremove file.s./debian/%s.pyremoveRVsutf-8RWs"%s.pyremove: unrecognized line: %sRYs-%s.pyremove: no matching versions for line %sRZs/%s.pyremove: nothing to remove: python%d.%d, %s(R3RRR[R%R\t	REMOVE_RER.R,R'R^R_R(RRRRRcR+R RdR*tOSError(RRYReRfRgRhRiRjRRkR4te((s$/usr/share/python/debpython/tools.pytpyremoveÿsN
	
	

	
(.t
__future__RR[tloggingR tretcPickleRRtos.pathRRRRtshutilRt
subprocessRR	tdebpython.versionR
RRt	getLoggerRTR'tcompileRGR-RAtVERBOSER]RpR)R,RRR"R:R>RERJtobjectRKRoRs(((s$/usr/share/python/debpython/tools.pyt<module>s8"	
	$				?

Copyright © 2017 || Recoded By Mr.Bumblebee