ok

Mini Shell

Direktori : /proc/self/root/proc/self/root/proc/self/root/proc/thread-self/root/lib64/python2.7/
Upload File :
Current File : //proc/self/root/proc/self/root/proc/self/root/proc/thread-self/root/lib64/python2.7/runpy.pyc

�
]цdc@s{dZddlZddlZddlmZyddlmZWn!ek
reddlmZnXddgZdefd��YZ	d	efd
��YZ
dddddd�Zdddddd�Z
d
�Zd�Zd�Zed�Zdded�Zd�Zd�Zddd�Zedkrweej�dkrYejdIJqwejd=eejd�ndS(sZrunpy.py - locating and running Python code using the module namespace

Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.

This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as well as when importing modules.
i����N(t	read_code(t
get_loadert
run_moduletrun_patht_TempModulecBs)eZdZd�Zd�Zd�ZRS(sCTemporarily replace a module in sys.modules with an empty namespacecCs(||_tj|�|_g|_dS(N(tmod_nametimpt
new_moduletmodulet
_saved_module(tselfR((s/usr/lib64/python2.7/runpy.pyt__init__s	cCsL|j}y|jjtj|�Wntk
r7nX|jtj|<|S(N(RR	tappendtsystmodulestKeyErrorR(R
R((s/usr/lib64/python2.7/runpy.pyt	__enter__s	
cGs=|jr#|jdtj|j<n
tj|j=g|_dS(Ni(R	R
RR(R
targs((s/usr/lib64/python2.7/runpy.pyt__exit__(s	
(t__name__t
__module__t__doc__RRR(((s/usr/lib64/python2.7/runpy.pyRs			t_ModifiedArgv0cBs#eZd�Zd�Zd�ZRS(cCs ||_t�|_|_dS(N(tvaluetobjectt_saved_valuet	_sentinel(R
R((s/usr/lib64/python2.7/runpy.pyR0s	cCsE|j|jk	r!td��ntjd|_|jtjd<dS(NsAlready preserving saved valuei(RRtRuntimeErrorR
targvR(R
((s/usr/lib64/python2.7/runpy.pyR4scGs |j|_|jtjd<dS(Ni(RRRR
R(R
R((s/usr/lib64/python2.7/runpy.pyR:s(RRRRR(((s/usr/lib64/python2.7/runpy.pyR/s		c	BsJ|dk	r|j|�n|jd|d|d|d|�||U|S(s)Helper to run code in nominated namespaceRt__file__t
__loader__t__package__N(tNonetupdate(tcodetrun_globalstinit_globalsRt	mod_fnamet
mod_loadertpkg_name((s/usr/lib64/python2.7/runpy.pyt	_run_code>scCsZt|��B}t|��-|jj}t|||||||�WdQXWdQX|j�S(s5Helper to run code in new namespace with sys modifiedN(RRRt__dict__R(tcopy(R"R$RR%R&R'ttemp_moduletmod_globals((s/usr/lib64/python2.7/runpy.pyt_run_module_codeKs
cCs=x6dD].}t||d�}|dk	r||�SqWdS(Ntget_filenamet
_get_filename(sget_filenames
_get_filename(tgetattrR (tloaderRtattrtmeth((s/usr/lib64/python2.7/runpy.pyR/\s

cCs�t|�}|dkr+td|��n|j|�r�|dksU|jd�rdtd��ny|d}t|�SWq�tk
r�}tdd||f��q�Xn|j|�}|dkr�td|��nt||�}||||fS(NsNo module named %st__main__s	.__main__s%Cannot use package as __main__ modules%s; %r is a package and cannot sbe directly executedsNo code object available for %s(RR tImportErrort
is_packagetendswitht_get_module_detailstget_codeR/(RR1t
pkg_main_nameteR"tfilename((s/usr/lib64/python2.7/runpy.pyR8ds"
cCscd}yt|�SWnHtk
r^}|t|�krXtd|tjdf��n�nXdS(NR4scan't find %r module in %ri(R8R5tstrR
tpath(t	main_nametexc((s/usr/lib64/python2.7/runpy.pyt_get_main_module_detailsxsc		Cs�yF|s|dkr0t|�\}}}}nt�\}}}}Wn9tk
r�}dtjt|�f}tj|�nX|jd�d}tjdj	}|r�|tj
d<nt||dd|||�S(s�Runs the designated module in the __main__ namespace

       Note that the executed module will have full access to the
       __main__ namespace. If this is not desirable, the run_module()
       function should be used to run the module code in a fresh namespace.

       At the very least, these variables in __main__ will be overwritten:
           __name__
           __file__
           __loader__
           __package__
    R4s%s: %st.iN(
R8RAR5R
t
executableR=texitt
rpartitionRR)RR(R (	Rt
alter_argvR1R"tfnameR@tmsgR'tmain_globals((s/usr/lib64/python2.7/runpy.pyt_run_module_as_main�s
cCst|�\}}}}|dkr-|}n|jd�d}|r_t||||||�St|i|||||�SdS(snExecute a module's code without importing it

       Returns the resulting top level namespace dictionary
    RBiN(R8R RER-R((RR$trun_namet	alter_sysR1R"RGR'((s/usr/lib64/python2.7/runpy.pyR�s	
cCs�tj}y||}Wn�tk
r�d||<x^tjD]+}y||�}PWq;tk
req;Xq;Wytj|�}Wntk
r�dSX|||<nX|S(s5Python version of PyImport_GetImporter C API functionN(R
tpath_importer_cacheRR t
path_hooksR5RtNullImporter(t	path_nametcachetimporterthook((s/usr/lib64/python2.7/runpy.pyt
_get_importer�s"	



c	Csgt|d��}t|�}WdQX|dkrct|d��}t|j�|d�}WdQXn|S(NtrbtrUtexec(topenRR tcompiletread(RGtfR"((s/usr/lib64/python2.7/runpy.pyt_get_code_from_file�s!c
Cs<|dkrd}nt|�}t|tj�rRt|�}t||||�Stjj	d|�z�d}tj
|}tj
|=zt�\}}}}	Wd|tj
|<Xd}
t|��H}t
|��3|jj}t|||||	||
�j�SWdQXWdQXWdytjj|�Wntk
r6nXXdS(s_Execute code located at the specified filesystem location

       Returns the resulting top level namespace dictionary

       The file path may refer directly to a Python script (i.e.
       one that could be directly executed with execfile) or else
       it may refer to a zipfile or directory containing a top
       level __main__.py script.
    s
<run_path>iR4Nt(R RTt
isinstanceRROR\R-R
R>tinsertRRARRRR)R(R*tremovet
ValueError(
RPR$RKRRR"R?t
saved_mainRR1RGR'R+R,((s/usr/lib64/python2.7/runpy.pyR�s0
	


&
R4is!No module specified for executioni(RR
RtpkgutilRRR5t__all__RRRR R(R-R/R8RAtTrueRJtFalseRRTR\RRtlenRtstderr(((s/usr/lib64/python2.7/runpy.pyt<module>s<
					
1


Zerion Mini Shell 1.0