��
���Lc@sdZddkZddkZyddklZWn#ej
oddklZnXdgZdddddd�Zdddddd�Z d�Z
d�Zed �Z
dded
�ZedjoFeei�djoeid
IJqeid=e
eid�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
get_loadert
run_modulec BsL|dj o|i|�n|id|d|d|d|�||U|S(sHelper for _run_module_codet__name__t__file__t
__loader__t__package__N(tNonetupdate(tcodetrun_globalstinit_globalstmod_namet mod_fnamet
mod_loadertpkg_name((s/usr/lib/python2.6/runpy.pyt _run_codes
cCs�ti|�}|i}tid}|tij} | oti|}
n|tid<|ti|<z t|||||||�Wd|tid<| o|
ti|<nti|=X|i�S(sHelper for run_moduleiN(timpt
new_modulet__dict__tsystargvtmodulesRtcopy(RR
RRR
Rttemp_moduletmod_globalstsaved_argv0trestore_moduletsaved_module((s/usr/lib/python2.6/runpy.pyt_run_module_code%s"
cCs?x8dD]0}t||d�}|dj o||�SqWdS(Ntget_filenamet
_get_filename(Rs
_get_filename(tgetattrR(tloaderRtattrtmeth((s/usr/lib/python2.6/runpy.pyRFs
cCs�t|�}|djotd|��n|i|�otdd|��n|i|�}|djotd|��nt||�}|||fS(NsNo module named %ss%s is a package and cannot sbe directly executedsNo code object available for %s(RRtImportErrort
is_packagetget_codeR(RR Rtfilename((s/usr/lib/python2.6/runpy.pyt_get_module_detailsNs
c
Cs�yt|�\}}}Wn]tj
oQ}|ot|�}ndtid}dti|f}ti|�nX|id�d}tidi } |o|tid<nt
|| dd|||�S(s�Runs the designated module in the __main__ namespace
These __*__ magic variables will be overwritten:
__file__
__loader__
scan't find '__main__.py' in %ris%s: %st.t__main__N(R'R#tstrRRt
executabletexitt
rpartitionRRRR(
Rt set_argv0R RtfnametexctinfotmsgRtmain_globals((s/usr/lib/python2.6/runpy.pyt_run_module_as_main`scCs�t|�\}}}|djo
|}n|id�d}|ot||||||�St|h|||||�SdS(snExecute a module's code without importing it
Returns the resulting top level namespace dictionary
R(iN(R'RR-RR(RR
trun_namet alter_sysR RR/R((s/usr/lib/python2.6/runpy.pyR|s
R)is!No module specified for executioni(t__doc__RRRR#tpkgutilt__all__RRRRR'tTrueR4tFalseRRtlenRtstderr(((s/usr/lib/python2.6/runpy.pyt<module>s.