ok

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/setuptools/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyo

�
0��`c@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
ddlZejjd�r�ddljjjjZnejejZy
eZWnek
r�dZnXeZddlmZddlm Z ddd	d
gZ!dd�Z"ej#dd��Z$ej#d
��Z%ej#d��Z&ej#d��Z'de(fd��YZ)dd"d��YZ*ej#d��Z+d�Z,ej#d��Z-ej#d��Z.d�Z/d�Z0d�Z1dd#d��YZ2e3ed�rBej4gZ5ngZ5y'ddl6m7Z7e5j8e7��[7Wne9k
r�nXde2fd��YZ:ej;ej<gdj=�D]Z>e?ee>d �^q��Z@d	efd!��YZAdS($i����N(tsix(tbuiltinstmaptjava(tDistutilsError(tworking_settAbstractSandboxtDirectorySandboxtSandboxViolationt	run_setupcBs�d}e||��}|j�}WdQXejd dkscejd dkr�ejd d
kr�|jdd�}|jd	d�}n|dkr�|}ne||d
�}|||UdS(s.
    Python 3 implementation of execfile.
    trbNiiiis
s
s
texec(ii(ii(ii(topentreadtsystversion_infotreplacetNonetcompile(tfilenametglobalstlocalstmodetstreamtscripttcode((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt	_execfile s9	ccs>tj}|dk	r#|tj(nz	|VWd|tj(XdS(N(RtargvR(trepltsaved((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt	save_argv1s

	ccs%tj}z	|VWd|tj(XdS(N(Rtpath(R((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt	save_path<s
	ccsNtjj|�s"tj|�ntj}|t_z	dVWd|t_XdS(sL
    Monkey-patch tempfile.tempdir with replacement, ensuring it exists
    N(tosRtisdirtmakedirsttempfilettempdir(treplacementR((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt
override_tempEs			ccs7tj�}tj|�z	|VWdtj|�XdS(N(R!tgetcwdtchdir(ttargetR((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pytpushdWs

	tUnpickleableExceptioncBseZdZed��ZRS(sP
    An exception representing another Exception that could not be pickled.
    cCsay tj|�tj|�fSWn:tk
r\ddlm}|j||t|���SXdS(s�
        Always return a dumped (pickled) type and exc. If exc can't be pickled,
        wrap it in UnpickleableException first.
        i����(R,N(tpickletdumpst	Exceptiontsetuptools.sandboxR,tdumptrepr(ttypetexctcls((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR1es
 
(t__name__t
__module__t__doc__tstaticmethodR1(((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR,astExceptionSavercBs)eZdZd�Zd�Zd�ZRS(s^
    A Context Manager that will save an exception, serialized, and restore it
    later.
    cCs|S(N((tself((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt	__enter__xscCs,|s
dStj||�|_||_tS(N(R,R1t_savedt_tbtTrue(R;R3R4ttb((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt__exit__{s
	cCsKdt|�krdSttj|j�\}}tj|||j�dS(s"restore and re-raise any exceptionR=N(tvarsRR-tloadsR=RtreraiseR>(R;R3R4((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pytresume�s(R6R7R8R<RARE(((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR:ss		c#sgtjj��t��}�VWdQXtjj���fd�tjD�}t|�|j�dS(s�
    Context in which imported modules are saved.

    Translates exceptions internal to the context into the equivalent exception
    outside the context.
    Nc3s1|]'}|�kr|jd�r|VqdS(s
encodings.N(t
startswith(t.0tmod_name(R(sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pys	<genexpr>�s(RtmodulestcopyR:tupdatet_clear_modulesRE(t	saved_exctdel_modules((RsC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pytsave_modules�s
cCs%xt|�D]}tj|=q
WdS(N(tlistRRI(tmodule_namesRH((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyRL�sccs*tj�}z	|VWdtj|�XdS(N(t
pkg_resourcest__getstate__t__setstate__(R((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pytsave_pkg_resources_state�s	ccs�tjj|d�}t��qt��at�t��Jt��:t|��'t	|��t
d�dVWdQXWdQXWdQXWdQXWdQXWdQXdS(Nttempt
setuptools(R!RtjoinRUROthide_setuptoolsR RR'R+t
__import__(t	setup_dirttemp_dir((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt
setup_context�s






cCs"tjd�}t|j|��S(sH
    >>> _needs_hiding('setuptools')
    True
    >>> _needs_hiding('pkg_resources')
    True
    >>> _needs_hiding('setuptools_plugin')
    False
    >>> _needs_hiding('setuptools.__init__')
    True
    >>> _needs_hiding('distutils')
    True
    >>> _needs_hiding('os')
    False
    >>> _needs_hiding('Cython')
    True
    s1(setuptools|pkg_resources|distutils|Cython)(\.|$)(treRtbooltmatch(RHtpattern((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt
_needs_hiding�scCs tttj�}t|�dS(s%
    Remove references to setuptools' modules from sys.modules to allow the
    invocation to import the most appropriate setuptools. This technique is
    necessary to avoid issues such as #315 where setuptools upgrading itself
    would fail to find a function declared in the metadata.
    N(tfilterRbRRIRL(RI((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyRY�sc	s�tjjtjj���}t|���ym�gt|�tj(tjjd|�t	j
�t	jjd���fd�}t
|�j|�Wn/tk
r�}|jr�|jdr��q�nXWdQXdS(s8Run a distutils setup script, sandboxed in its directoryicSs
|j�S(N(tactivate(tdist((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt<lambda>�tcs&td�dd�}t�|�dS(Nt__file__R6t__main__(tdictR(tns(tsetup_script(sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pytrunner�sN(R!RtabspathtdirnameR]RPRRtinsertRt__init__t	callbackstappendRtrunt
SystemExittargs(RlRvR[Rmtv((RlsC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR	�s

cBs�eZdZeZd�Zd�Zd�Zd�Zx<dddgD]+Z	e
ee	�rFee	�e�e	<qFqFWd'd�Zer�ed	e�Zned
e�Zxlddd
d
dddddddddddddddgD]+Z	e
ee	�r�ee	�e�e	<q�q�Wd�Zx9ddgD]+Z	e
ee	�r-ee	�e�e	<q-q-Wd �Zx9d!d"gD]+Z	e
ee	�rree	�e�e	<qrqrWd#�Zd$�Zd%�Zd&�ZRS((sDWrap 'os' module and 'open()' builtin for virtualizing setup scriptscCsEgtt�D]+}|jd�r
t||�r
|^q
|_dS(Nt_(tdirt_osRFthasattrt_attrs(R;tname((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyRq�scCs1x*|jD]}tt|t||��q
WdS(N(R|tsetattrR!tgetattr(R;tsourceR}((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt_copyscCs{zB|j|�tr%|jt_n|jt_t|_|�SWdt|_tr`tt_ntt_|jt	�XdS(sRun 'func' under os sandboxingN(
R�t_fileRtfilet_openRR?t_activetFalseRz(R;tfunc((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyRt	s
			cs%tt�����fd�}|S(Ncs@|jr-|j�||||�\}}n�||||�S(N(R�t_remap_pair(R;tsrctdstRvtkw(R}toriginal(sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pytwraps	$(RRz(R}R�((R}R�sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt_mk_dual_path_wrapperstrenametlinktsymlinkcs+�ptt�����fd�}|S(Ncs4|jr$|j�|||�}n�|||�S(N(R�t_remap_input(R;RRvR�(R}R�(sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR�&s	(RRz(R}R�R�((R}R�sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt_mk_single_path_wrapper$sR�RtstattlistdirR)tchmodtchowntmkdirtremovetunlinktrmdirtutimetlchowntchroottlstatt	startfiletmkfifotmknodtpathconftaccesscs%tt�����fd�}|S(NcsM|jr=|j�|||�}|j��|||��S�|||�S(N(R�R�t
_remap_output(R;RRvR�(R}R�(sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR�8s	(RRz(R}R�((R}R�sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt_mk_single_with_return6streadlinkttempnamcs%tt�����fd�}|S(Ncs,�||�}|jr(|j�|�S|S(N(R�R�(R;RvR�tretval(R}R�(sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR�Ds	(RRz(R}R�((R}R�sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt	_mk_queryBsR(ttmpnamcCs|S(s=Called to remap or validate any path, whether input or output((R;R((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt_validate_pathNscOs
|j|�S(sCalled for path inputs(R�(R;t	operationRRvR�((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR�RscCs
|j|�S(sCalled for path outputs(R�(R;R�R((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR�VscOs6|j|d|||�|j|d|||�fS(s?Called for path pairs like rename, link, and symlink operationss-froms-to(R�(R;R�R�R�RvR�((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR�ZsN(R6R7R8R�R�RqR�RtR�R}R{RzRRR�R�R�R�R�R�R�R�R�(((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR�s>											tdevnull(tGetGeneratePathcBs�eZdZejddddddddd	d
ddd
g
�ZdgZed�Zd�Z	e
rudd�Z
ndd�Zd�Zd�Z
d�Zd�Zd�Zdd�ZRS(s<Restrict operations to a single subdirectory - pseudo-chrootRR�R�R�R�R�R�R�R�R�R�R�R�s.*lib2to3.*\.pickle$cCs�tjjtjj|��|_tjj|jd�|_g|D]$}tjjtjj|��^qC|_tj	|�dS(NRg(
R!Rtnormcasetrealpatht_sandboxRXt_prefixt_exceptionsRRq(R;tsandboxt
exceptionsR((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyRq}s
!1cOs&ddlm}||||��dS(Ni����(R(R0R(R;R�RvR�R((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt
_violation�strcOsK|dkr8|j|�r8|jd||||�nt||||�S(NR�trtR
trUtUR�(R�R�R
R�R�(t_okR�R�(R;RRRvR�((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR��scOsK|dkr8|j|�r8|jd||||�nt||||�S(NR�R�R
R�R�R(R�R�R
R�R�(R�R�R�(R;RRRvR�((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR��scCs|jd�dS(NR�(R�(R;((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR��scCss|j}zYt|_tjjtjj|��}|j|�p`||jkp`|j|j	�SWd||_XdS(N(
R�R�R!RR�R�t	_exemptedR�RFR�(R;RtactiveR�((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR��s		csN�fd�|jD�}�fd�|jD�}tj||�}t|�S(Nc3s|]}�j|�VqdS(N(RF(RGt	exception(tfilepath(sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pys	<genexpr>�sc3s!|]}tj|��VqdS(N(R^R`(RGRa(R�(sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pys	<genexpr>�s(R�t_exception_patternst	itertoolstchaintany(R;R�t
start_matchestpattern_matchest
candidates((R�sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR��s

cOsH||jkrD|j|�rD|j|tjj|�||�n|S(sCalled for path inputs(t	write_opsR�R�R!RR�(R;R�RRvR�((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR��s%cOsF|j|�s |j|�r<|j|||||�n||fS(s?Called for path pairs like rename, link, and symlink operations(R�R�(R;R�R�R�RvR�((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR��s i�cOsR|t@r9|j|�r9|jd|||||�ntj|||||�S(sCalled for low-level os.open()sos.open(tWRITE_FLAGSR�R�RzR(R;R�tflagsRRvR�((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR�s(R6R7R8RjtfromkeysR�R�t_EXCEPTIONSRqR�R�R�R�R�R�R�R�R(((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyRos 					
			s4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYicBseZdZd�ZRS(sEA setup script attempted to modify the filesystem outside the sandboxcCsd|jS(Ns�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.(Rv(R;((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt__str__�s	(R6R7R8R�(((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyR�s(((BR!RR$toperatort	functoolsR�R^t
contextlibR-tsetuptools.externRtsetuptools.extern.six.movesRRRRtplatformRFt$org.python.modules.posix.PosixModuletpythonRItposixtPosixModuleRzR}R�R�t	NameErrorRRR�tdistutils.errorsRRt__all__RtcontextmanagerRR R'R+R/R,R:RORLRUR]RbRYR	RR{R�R�twin32com.client.gencacheR�RstImportErrorRtreducetor_tsplittaRR�R(((sC/opt/alt/python27/lib/python2.7/site-packages/setuptools/sandbox.pyt<module>sh



	
					h
T	+

Zerion Mini Shell 1.0