-=[ 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/namespace.pyc

ó
([Uc@€sëddlmZddlZddlmZmZmZmZddlm	Z	m
Z
mZmZm
Z
ddlmZmZddlmZddlmZmZejeƒZdd„Zedd	„ƒZddd
„Zd„ZdS(i˙˙˙˙(twith_statementN(tenvirontlistdirtremovetrmdir(tdirnametexiststjointgetsizetsplit(tPopentPIPE(t
PUBLIC_DIR_RE(tmemoizetsitedircC€slt|pgƒ}xS|D]K}t|dƒ4}x*|D]"}|r8|j|jƒƒq8q8WWdQXqW|S(s#Parse namespace_packages.txt files.trN(tsettopentaddtstrip(tfpathstothertresulttfpathtfptline((s(/usr/share/python/debpython/namespace.pytparse"s

$cC€sľd}dtjddƒ}|rLt||ƒ}t|ƒrƒ|g}qƒn7t|ƒrƒgt|ƒD]}t||ƒ^qe}n|r¨td„t|ƒDƒƒ}n	tƒ}|S(s~Return a set of namespaces to regenerate/clean.

    :param package: limit namespaces to the ones needed by given package
    s%s/usr/share/python/ns/tDESTDIRtcs€s!|]}|jddƒVqdS(t.t/N(treplace(t.0ti((s(/usr/share/python/debpython/namespace.pys	<genexpr>AsN(tNoneRtgetRRRRR(tpackageRtnsdirRR!R((s(/usr/share/python/debpython/namespace.pytload-s+	cc€sU|dk	r-t|ƒ}tƒ}tƒ}nx/|D]'}|V|dkrQq4nt|ƒ}||kr4|j|ƒtj|ƒ}|r[|jƒ}	xž||	krT|t|	ƒd}
|
|kr4t	|dƒ}|t
kr$yt|dƒjƒWn!t
k
rtjd|ƒq1X|Vq4|j|ƒn|j|ƒt|ƒd}qšWq[q4q4W|tkrQ|rQtddj	|ƒdt
d	tƒ}|jƒ\}
}xF|
jƒD]8}|jd
dƒd}||krľ|j|ƒqľqľWx]|D]R}yt|ƒWn6ttfk
rD}tjd|ƒtj|ƒqřX|VqřWndS(
s)Add __init__.py files to given generator.is__init__.pytascannot create %sis/usr/bin/dpkg -S %s 2>/dev/nullt tshelltstdouts: scannot remove %sN(R"R&RRRRtmatchtgrouptlenRtTrueRtcloset	ExceptiontlogterrorR	tFalseR
Rtcommunicatet
splitlinesRtIOErrortOSErrortdebug(tfilesR$tactiont
namespacestalready_processedtremoval_candidatestfntdpathtmt
public_dirtns_dirRtprocessR*tstderrRtnste((s(/usr/share/python/debpython/namespace.pytadd_namespace_filesGsT	




c	C€sŻt|tƒst|ƒ}ntƒ}x”|D]Œ}xƒ|D]{}tt||ƒ|jdƒŒ}t|dƒ}t|ƒsƒq;nt|ƒdkr;tjd|ƒ|j	|ƒPq;q;Wq.W||}xŕ|D]Ř}xp|D]h}tt||ƒ|jdƒŒ}t|dƒ}t|ƒrÜt
|ƒt|ƒsDt|ƒqDqÜqÜWtd|d|jdƒŒ}t|dƒ}t|ƒrĎt
|ƒt|ƒs§t|ƒq§qĎqĎW|S(s8Remove empty __init__.py files for requested namespaces.Rs__init__.pyis)file not empty, cannot share %s namespacetdebiansusr/share/pyshared(
t
isinstanceRRRR	RRR1twarningRRRR(	R$R;tversionstkeepREtversionRRR?((s(/usr/share/python/debpython/namespace.pytremove_from_packages:	

!



!

(t
__future__RtloggingtosRRRRtos.pathRRRRR	t
subprocessR
Rtdebpython.pydistRtdebpython.toolsR
Rt	getLoggert__name__R1R"RR&RGRN(((s(/usr/share/python/debpython/namespace.pyt<module>s"(8

Copyright © 2017 || Recoded By Mr.Bumblebee