Your IP : 18.227.0.21


Current Path : /opt/alt/python33/lib/python3.3/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/setuptools/__pycache__/sandbox.cpython-33.pyc

�
�Re
'c@s�ddlZddlZddlZddlZddlZddlZddlZddlZejdkr�ddl	j
jjj
ZnejejZy
eZWnek
r�dZYnXeZddlmZddlmZddlmZmZdddd	gZd
d	�ZGdd�d�Zeed�rJejgZ ngZ y'dd
l!m"Z"e j#e"��["Wne$k
r�YnXGdd�de�Z%ej&ej'dd�dj(�D��Z)Gdd�de�Z*dS(iNujava(uDistutilsError(uworking_set(ubuiltinsuexecfileuAbstractSandboxuDirectorySandboxuSandboxViolationu	run_setupcstj�}tjdd�}tjdd�}tjjtjj���}tjj|d�}tjj|�s�tj	|�nt
j}tjj
��tj�}z�|t
_tj|�yv�gt|�tjdd�<tjjd|�tj�tjjdd��t|�j�fdd��Wn>tk
rztj�d}	|	jrv|	jdrv�nYnXWdtj|�tjj���fdd	�tjD�}
tttjj|
��tj|�|tjdd�<|tjdd�<|t
_XdS(
u8Run a distutils setup script, sandboxed in its directoryNutempicSs
|j�S(N(uactivate(udist((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu<lambda>0surun_setup.<locals>.<lambda>cstdi�d6dd6�S(Nusetup.pyu__file__u__main__u__name__(uexecfile((usetup_script(u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu<lambda>2sics2g|](}|�kr|jd�r|�qS(u
encodings.(u
startswith(u.0umod_name(usave_modules(u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu
<listcomp>As	urun_setup.<locals>.<listcomp>( uosugetcwdusysuargvupathuabspathudirnameujoinuisdirumakedirsutempfileutempdirumodulesucopyu
pkg_resourcesu__getstate__uchdirulistuinsertuworking_setu__init__u	callbacksuappenduDirectorySandboxurunu
SystemExituexc_infouargsu__setstate__uupdateumapu__delitem__(usetup_scriptuargsuold_diru	save_argvu	save_pathu	setup_dirutemp_dirusave_tmpupr_stateuvudel_modules((usave_modulesusetup_scriptu+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu	run_setups@		
 



cBs�|EeZdZdZd4Zdd�Zdd�Zdd�Zdd	�Z	x<d
ddgD]+Z
eee
�r\e	e
�e
�e
<q\q\Wd3d
d�Zer�ede�Znede�Zxlddddddddddddddddd d!d"gD]+Z
eee
�ree
�e
�e
<qqWd#d$�Zx9d%d&gD]+Z
eee
�rIee
�e
�e
<qIqIWd'd(�Zx9d)d*gD]+Z
eee
�r�ee
�e
�e
<q�q�Wd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3S(5uAbstractSandboxuDWrap 'os' module and 'open()' builtin for virtualizing setup scriptscs&�fdd�tt�D��_dS(Ncs5g|]+}|jd�rt�|�r|�qS(u_(u
startswithuhasattr(u.0uname(uself(u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu
<listcomp>Ts	u,AbstractSandbox.__init__.<locals>.<listcomp>(udiru_osu_attrs(uself((uselfu+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu__init__RsuAbstractSandbox.__init__cCs1x*|jD]}tt|t||��q
WdS(N(u_attrsusetattruosugetattr(uselfusourceuname((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_copyXsuAbstractSandbox._copycCs{zB|j|�tr%|jt_n|jt_d|_|�SWdd|_tr`tt_ntt_|jt	�XdS(uRun 'func' under os sandboxingNTF(
u_copyu_fileubuiltinsufileu_openuopenuTrueu_activeuFalseu_os(uselfufunc((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyurun\s
			uAbstractSandbox.runcs(tt�����fdd�}|S(Ncs@|jr-|j�||||�\}}n�||||�S(N(u_activeu_remap_pair(uselfusrcudstuargsukw(unameuoriginal(u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyuwrapns	$u3AbstractSandbox._mk_dual_path_wrapper.<locals>.wrap(ugetattru_os(unameuwrap((unameuoriginalu+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_mk_dual_path_wrapperlsu%AbstractSandbox._mk_dual_path_wrapperurenameulinkusymlinkcs.�ptt�����fdd�}|S(Ncs4|jr$|j�|||�}n�|||�S(N(u_activeu_remap_input(uselfupathuargsukw(unameuoriginal(u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyuwrapys	u5AbstractSandbox._mk_single_path_wrapper.<locals>.wrap(ugetattru_os(unameuoriginaluwrap((unameuoriginalu+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_mk_single_path_wrapperwsu'AbstractSandbox._mk_single_path_wrapperufileuopenustatulistdiruchdiruchmoduchownumkdiruremoveuunlinkurmdiruutimeulchownuchrootulstatu	startfileumkfifoumknodupathconfuaccesscs(tt�����fdd�}|S(NcsM|jr=|j�|||�}|j��|||��S�|||�S(N(u_activeu_remap_inputu
_remap_output(uselfupathuargsukw(unameuoriginal(u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyuwrap�s	u4AbstractSandbox._mk_single_with_return.<locals>.wrap(ugetattru_os(unameuwrap((unameuoriginalu+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_mk_single_with_return�su&AbstractSandbox._mk_single_with_returnureadlinkutempnamcs(tt�����fdd�}|S(Ncs,�||�}|jr(|j�|�S|S(N(u_activeu
_remap_output(uselfuargsukwuretval(unameuoriginal(u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyuwrap�s	u'AbstractSandbox._mk_query.<locals>.wrap(ugetattru_os(unameuwrap((unameuoriginalu+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu	_mk_query�suAbstractSandbox._mk_queryugetcwdutmpnamcCs|S(u=Called to remap or validate any path, whether input or output((uselfupath((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_validate_path�suAbstractSandbox._validate_pathcOs
|j|�S(uCalled for path inputs(u_validate_path(uselfu	operationupathuargsukw((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_remap_input�suAbstractSandbox._remap_inputcCs
|j|�S(uCalled for path outputs(u_validate_path(uselfu	operationupath((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu
_remap_output�suAbstractSandbox._remap_outputcOs6|j|d|||�|j|d|||�fS(u?Called for path pairs like rename, link, and symlink operationsu-fromu-to(u_remap_input(uselfu	operationusrcudstuargsukw((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_remap_pair�suAbstractSandbox._remap_pairNF(u__name__u
__module__u__qualname__u__doc__uFalseu_activeu__init__u_copyurunu_mk_dual_path_wrapperunameuhasattru_osulocalsuNoneu_mk_single_path_wrapperu_fileu_openu_mk_single_with_returnu	_mk_queryu_validate_pathu_remap_inputu
_remap_outputu_remap_pair(u
__locals__((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyuAbstractSandboxMs>		udevnull(uGetGeneratePathcBs�|EeZdZdZejdddddddd	d
ddd
dg
�ZdgZedd�Z	dd�Z
er�ddd�Znddd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$d%�Zd&S('uDirectorySandboxu<Restrict operations to a single subdirectory - pseudo-chrootuopenuchmoduchownumkdiruremoveuunlinkurmdiruutimeulchownuchrootumkfifoumknodutempnamu.*lib2to3.*\.pickle$cCsctjjtjj|��|_tjj|jd�|_dd�|D�|_tj	|�dS(NucSs.g|]$}tjjtjj|���qS((uosupathunormcaseurealpath(u.0upath((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu
<listcomp>�s	u-DirectorySandbox.__init__.<locals>.<listcomp>(
uosupathunormcaseurealpathu_sandboxujoinu_prefixu_exceptionsuAbstractSandboxu__init__(uselfusandboxu
exceptions((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu__init__�s
!	
uDirectorySandbox.__init__cOst|||��dS(N(uSandboxViolation(uselfu	operationuargsukw((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu
_violation�suDirectorySandbox._violationurcOsK|dkr8|j|�r8|jd||||�nt||||�S(NururturburUuUufile(ururturburUuU(u_oku
_violationu_file(uselfupathumodeuargsukw((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_file�suDirectorySandbox._filecOsK|dkr8|j|�r8|jd||||�nt||||�S(NururturburUuUuopen(ururturburUuU(u_oku
_violationu_open(uselfupathumodeuargsukw((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_open�suDirectorySandbox._opencCs|jd�dS(Nutmpnam(u
_violation(uself((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyutmpnam�suDirectorySandbox.tmpnamcCss|j}zYd|_tjjtjj|��}|j|�p`||jkp`|j|j	�SWd||_XdS(NF(
u_activeuFalseuosupathunormcaseurealpathu	_exemptedu_sandboxu
startswithu_prefix(uselfupathuactiveurealpath((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_ok�s		uDirectorySandbox._okcsT�fdd�|jD�}�fdd�|jD�}tj||�}t|�S(Nc3s|]}�j|�VqdS(N(u
startswith(u.0u	exception(ufilepath(u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu	<genexpr>�su-DirectorySandbox._exempted.<locals>.<genexpr>c3s!|]}tj|��VqdS(N(ureumatch(u.0upattern(ufilepath(u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu	<genexpr>�s(u_exceptionsu_exception_patternsu	itertoolsuchainuany(uselfufilepathu
start_matchesupattern_matchesu
candidates((ufilepathu+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu	_exempted�s

uDirectorySandbox._exemptedcOsH||jkrD|j|�rD|j|tjj|�||�n|S(uCalled for path inputs(u	write_opsu_oku
_violationuosupathurealpath(uselfu	operationupathuargsukw((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_remap_inputs%uDirectorySandbox._remap_inputcOsF|j|�s |j|�r<|j|||||�n||fS(u?Called for path pairs like rename, link, and symlink operations(u_oku
_violation(uselfu	operationusrcudstuargsukw((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu_remap_pair	s uDirectorySandbox._remap_pairi�cOsR|t@r9|j|�r9|jd|||||�ntj|||||�S(uCalled for low-level os.open()uos.open(uWRITE_FLAGSu_oku
_violationu_osuopen(uselfufileuflagsumodeuargsukw((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyuopensuDirectorySandbox.openN(u__name__u
__module__u__qualname__u__doc__udictufromkeysu	write_opsu_exception_patternsu_EXCEPTIONSu__init__u
_violationu_fileu_openutmpnamu_oku	_exemptedu_remap_inputu_remap_pairuopen(u
__locals__((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyuDirectorySandbox�s 		
cCs"g|]}tt|d��qS(i(ugetattru_os(u.0ua((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu
<listcomp>s	u
<listcomp>u4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYcBs&|EeZdZdZdd�ZdS(uSandboxViolationuEA setup script attempted to modify the filesystem outside the sandboxcCsd|jS(Nu�SandboxViolation: %s%r %s

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.(uargs(uself((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu__str__s	uSandboxViolation.__str__N(u__name__u
__module__u__qualname__u__doc__u__str__(u
__locals__((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyuSandboxViolations(+uosusysutempfileuoperatoru	functoolsu	itertoolsureu
pkg_resourcesunameu$org.python.modules.posix.PosixModuleupythonumodulesuposixuPosixModuleu_osufileu_fileu	NameErroruNoneuopenu_openudistutils.errorsuDistutilsErroruworking_setusetuptools.compatubuiltinsuexecfileu__all__u	run_setupuAbstractSandboxuhasattrudevnullu_EXCEPTIONSuwin32com.client.gencacheuGetGeneratePathuappenduImportErroruDirectorySandboxureduceuor_usplituWRITE_FLAGSuSandboxViolation(((u+/tmp/pip-k8wh6o-build/setuptools/sandbox.pyu<module>sF

0h
S

?>