AlkantarClanX12

Your IP : 3.135.214.139


Current Path : /proc/self/root/opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python33/lib64/python3.3/__pycache__/modulefinder.cpython-33.pyc

�
��f�Zc@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	e
ejjd�g�Z
e
ejjd�g�Ze
ejjd�g�Ze
ejjd�g�ZeegZe
ejg�ZiZdd�ZiZd	d
�ZGdd�d�ZGd
d�d�Zdd�Zedkr�y
e�ZWnek
r}ed�YnXndS(u3Find modules used by a script, using introspection.iNu
LOAD_CONSTuIMPORT_NAMEu
STORE_NAMEuSTORE_GLOBALcCstj|g�j|�dS(N(upackagePathMapu
setdefaultuappend(upackagenameupath((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuAddPackagePathsuAddPackagePathcCs|t|<dS(N(ureplacePackageMap(uoldnameunewname((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuReplacePackage(suReplacePackagecBs2|EeZdZdddd�Zdd�ZdS(uModulecCs:||_||_||_d|_i|_i|_dS(N(u__name__u__file__u__path__uNoneu__code__uglobalnamesustarimports(uselfunameufileupath((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu__init__.s					uModule.__init__cCsjd|jf}|jdk	r6|d|jf}n|jdk	r\|d|jf}n|d}|S(Nu	Module(%ru, %ru)(u__name__u__file__uNoneu__path__(uselfus((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu__repr__;s
uModule.__repr__N(u__name__u
__module__u__qualname__uNoneu__init__u__repr__(u
__locals__((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuModule,s
uModulecBsg|EeZdZd5dggdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	d5d5d6dd�Z
d7dd�Zdd�Zdd�Z
ddd�Zdd�Zdd�Zdd�Zdd �Zd8d!d"�Zejd#d$�Zd%d&�Zd'd(�Zd)d*�Zd5d+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5S(9uModuleFindericCsd|dkrtj}n||_i|_i|_||_d|_||_||_g|_	dS(Ni(
uNoneusysupathumodulesu
badmodulesudebuguindentuexcludesu
replace_pathsuprocessed_paths(uselfupathudebuguexcludesu
replace_paths((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu__init__Fs							uModuleFinder.__init__cGs~||jkrzx't|j�D]}tddd�qWt|dd�x$|D]}tt|�dd�qPWt�ndS(Nu   uendu (udebugurangeuindentuprinturepr(uselfulevelustruargsuiuarg((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyumsgRs
uModuleFinder.msgcGs=|d}||jkr9|jd|_|j|�ndS(Nii(udebuguindentumsg(uselfuargsulevel((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyumsgin[s
uModuleFinder.msgincGs=|d}||jkr9|jd|_|j|�ndS(Nii(udebuguindentumsg(uselfuargsulevel((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyumsgoutas
uModuleFinder.msgoutcCsT|jdd|�t|��/}ddtjf}|jd|||�WdQXdS(Niu
run_scriptuuru__main__(umsguopenuimpu	PY_SOURCEuload_module(uselfupathnameufpustuff((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu
run_scriptgsuModuleFinder.run_scriptcCsqtjj|�\}}tjj|�\}}t|��/}|dtjf}|j||||�WdQXdS(Nur(uosupathusplitusplitextuopenuimpu	PY_SOURCEuload_module(uselfupathnameudirunameuextufpustuff((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu	load_filems
uModuleFinder.load_fileic	Cs�|jdd||||�|j|d|�}|j||�\}}|j||�}|se|S|jr�|j||�ndS(Niuimport_hookulevel(umsgudetermine_parentufind_head_packageu	load_tailu__path__uensure_fromlistuNone(	uselfunameucallerufromlistuleveluparentuqutailum((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuimport_hookts	uModuleFinder.import_hookcCs�|jdd||�|s)|dkr=|jdd�dS|j}|dkr|jrh|d8}n|dkr�|j|}||ks�t�|jdd|�|S|jd�|kr�td��ndj	|j
d�d|��}|j|}|jdd|�|S|jrT|j|}||ks=t�|jdd|�|Sd|kr�|jd�}|d|�}|j|}|j|ks�t�|jdd|�|S|jdd�dS(	Niudetermine_parentiudetermine_parent -> Noneiudetermine_parent ->u.urelative importpath too deep(umsginumsgoutuNoneu__name__u__path__umodulesuAssertionErrorucountuImportErrorujoinuspliturfind(uselfucallerulevelupnameuparentui((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyudetermine_parentsB		

#
	

uModuleFinder.determine_parentcCs>|jdd||�d|krX|jd�}|d|�}||dd�}n|}d}|r�d|j|f}n|}|j|||�}|r�|jdd||f�||fS|r|}d}|j|||�}|r|jdd||f�||fSn|jdd|�td	|��dS(
Niufind_head_packageu.iuu%s.%sufind_head_package ->u"raise ImportError: No module nameduNo module named (umsginufindu__name__u
import_moduleumsgoutuNoneuImportError(uselfuparentunameuiuheadutailuqnameuq((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyufind_head_package�s.

uModuleFinder.find_head_packagecCs�|jdd||�|}x�|r�|jd�}|dkrOt|�}n|d|�||dd�}}d|j|f}|j|||�}|s|jdd|�td|��qqW|jdd	|�|S(
Niu	load_tailu.iiu%s.%su"raise ImportError: No module nameduNo module named uload_tail ->(umsginufindulenu__name__u
import_moduleumsgoutuImportError(uselfuqutailumuiuheadumname((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu	load_tail�s	%uModuleFinder.load_tailcCs�|jdd|||�x�|D]�}|dkri|s�|j|�}|rf|j||d�qfq�q t||�s d|j|f}|j|||�}|s�td|��q�q q WdS(Niuensure_fromlistu*iu%s.%suNo module named (umsgufind_all_submodulesuensure_fromlistuhasattru__name__u
import_moduleuImportError(uselfumufromlistu	recursiveusubuallusubnameusubmod((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuensure_fromlist�s
uModuleFinder.ensure_fromlistc
CsE|js
dSi}g}|tjjdd�7}|tjjdd�7}|tjjdd�7}x�|jD]�}ytj|�}Wn+tjk
r�|j	dd|�wqYnXx||D]t}d}xF|D]>}t|�}	||	d�|kr�|d|	�}Pq�q�W|r�|dkr�|||<q�q�WqqW|j�S(Niucan't list directoryu__init__(
u__path__u	importlibu	machineryuEXTENSION_SUFFIXESuSOURCE_SUFFIXESuBYTECODE_SUFFIXESuosulistdiruerrorumsguNoneulenukeys(
uselfumumodulesusuffixesudirunamesunameumodusuffun((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyufind_all_submodules�s.	

u ModuleFinder.find_all_submodulescCs\|jdd|||�y|j|}Wntk
r>YnX|jdd|�|S||jkry|jdd�dS|r�|jdkr�|jdd�dSy+|j||o�|j|�\}}}Wn)tk
r�|jddd�dSYnXz|j	||||�}Wd|r+|j
�nX|rEt|||�n|jdd|�|S(Niu
import_moduleuimport_module ->uimport_module -> None(umsginumodulesuKeyErrorumsgoutu
badmodulesuNoneu__path__ufind_moduleuImportErroruload_moduleucloseusetattr(uselfupartnameufqnameuparentumufpupathnameustuff((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu
import_module�s6
	"
	uModuleFinder.import_modulec
Csu|\}}}|jdd||o'd|�|tjkrf|j||�}|jdd|�|S|tjkr�t|j�d|d�}	nu|tjkr|jd�tj	�kr�|jdd|�t
d	|��n|jd
�tj|�}	nd}	|j|�}||_|	r^|jrB|j|	�}	n|	|_|j|	|�n|jdd|�|S(Niuload_moduleufpuload_module ->u
uexeciu#raise ImportError: Bad magic numberuBad magic number in %si(umsginuimpu
PKG_DIRECTORYuload_packageumsgoutu	PY_SOURCEucompileureaduPY_COMPILEDu	get_magicuImportErrorumarshaluloaduNoneu
add_moduleu__file__u
replace_pathsureplace_paths_in_codeu__code__u	scan_code(
uselfufqnameufpupathnameu	file_infousuffixumodeutypeumuco((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuload_modules0
			uModuleFinder.load_modulecCsQ||jkri|j|<n|r<d|j||j<nd|j|d<dS(Niu-(u
badmodulesu__name__(uselfunameucaller((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu_add_badmodule0s
uModuleFinder._add_badmodulecCsP||jkr#|j||�dSy|j||d|�WnNtk
r�}z.|jddt|��|j||�WYdd}~Xn�X|rLx�|D]�}||jkr�|j||�q�ny |j|||gd|�Wq�tk
rD}z<|jddt|��|d|}|j||�WYdd}~Xq�Xq�WndS(NuleveliuImportError:u.(u
badmodulesu_add_badmoduleuimport_hookuImportErrorumsgustr(uselfunameucallerufromlistulevelumsgusubufullname((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu_safe_import_hook8s&#
 uModuleFinder._safe_import_hookc
csk|j}|j}|j}ttt}x;|rft|dg�}|tkr�|d|dd��\}d||ffV|dd�}q,n|ddd�|kr4|d|dd��\}	}
}||	}|dkrd||
||ffVnd	|||
||ffV|dd�}q,n|tkrS|dd�}q,|dd�}q,WdS(
Niu<Hiiustorei	u<xHxHxHuabsolute_importurelative_import(uco_codeuco_namesu	co_constsu
LOAD_CONSTuIMPORT_NAMEubytesu	STORE_OPSu
HAVE_ARGUMENT(
uselfucouunpackucodeunamesuconstsuLOAD_LOAD_AND_IMPORTucuoparguoparg_1uoparg_2uoparg_3ulevel((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuscan_opcodes_25Os,				"
uModuleFinder.scan_opcodes_25cCs<|j}|j}x�||�D]�\}}|dkrP|\}d|j|<q|dkr{|\}}d}	|dk	r�d|kr�d}	ndd�|D�}n|j|||dd�|	r�d}
|jr�|jj|jd	|�}
n|
dkr|jj|�}
n|
dk	rh|jj	|
j�|j
j	|
j
�|
jdkrud|j
|<quqxd|j
|<q�q|d
kr�|\}}}|r�|j|||d|�q�|j|d|�}|j|jd|dd�qt
|��qWx9|jD].}
t|
t|��r|j|
|�qqWdS(Nustoreiuabsolute_importiu*cSs"g|]}|dkr|�qS(u*((u.0uf((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu
<listcomp>ys	u*ModuleFinder.scan_code.<locals>.<listcomp>ulevelu.urelative_import(uco_codeuscan_opcodes_25uglobalnamesuNoneu_safe_import_hooku__path__umodulesugetu__name__uupdateustarimportsu__code__udetermine_parentuRuntimeErroru	co_constsu
isinstanceutypeu	scan_code(uselfucoumucodeuscanneruwhatuargsunameufromlistu	have_starummuleveluparentuc((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu	scan_codelsH					 uModuleFinder.scan_codecCs�|jdd||�tj|�}|r4|}n|j|�}||_|g|_|jtj|g�|_|jd|j�\}}}z1|j||||�|j	dd|�|SWd|r�|j
�nXdS(Niuload_packageu__init__uload_package ->(umsginureplacePackageMapugetu
add_moduleu__file__u__path__upackagePathMapufind_moduleuload_moduleumsgoutuclose(uselfufqnameupathnameunewnameumufpubufustuff((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuload_package�s		uModuleFinder.load_packagecCs5||jkr|j|St|�|j|<}|S(N(umodulesuModule(uselfufqnameum((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu
add_module�suModuleFinder.add_modulecCs�|dk	r |jd|}n|}||jkrW|jdd|�t|��n|dkr�|tjkr�ddddtjffS|j	}ntj
||�S(Nu.iufind_module -> Excludedu(uNoneu__name__uexcludesumsgoutuImportErrorusysubuiltin_module_namesuimpu	C_BUILTINupathufind_module(uselfunameupathuparentufullname((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyufind_module�suModuleFinder.find_modulecCs�t�tdd�tdd�t|jj��}xa|D]Y}|j|}|jrntddd�ntddd�td	||jp�d
�q?W|j�\}}|rt�td�xF|D];}t|j|j��}td|d
dj|��q�Wn|r~t�tddd�td�xF|D];}t|j|j��}td|d
dj|��q<WndS(u�Print a report to stdout, listing the found modules with their
        paths, as well as modules that are missing, or seem to be missing.
        u
  %-25s %suNameuFileu----uPuendu umu%-25suuMissing modules:u?u
imported fromu, u7Submodules that appear to be missing, but could also beu#global names in the parent package:N(uNameuFile(u----u----(	uprintusortedumodulesukeysu__path__u__file__uany_missing_maybeu
badmodulesujoin(uselfukeysukeyumumissingumaybeunameumods((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyureport�s0

	

#

uModuleFinder.reportcCs|j�\}}||S(u�Return a list of modules that appear to be missing. Use
        any_missing_maybe() if you want to know which modules are
        certain to be missing, and which *may* be missing.
        (uany_missing_maybe(uselfumissingumaybe((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuany_missing�suModuleFinder.any_missingcCs.g}g}x|jD]�}||jkr1qn|jd�}|dkr_|j|�qn||dd�}|d|�}|jj|�}|dk	r�||j|kr�|j|�q||jkr�q|jr�|j|�q|j|�q|j|�qW|j	�|j	�||fS(u�Return two lists, one with modules that are certainly missing
        and one with modules that *may* be missing. The latter names could
        either be submodules *or* just global names in the package.

        The reason it can't always be determined is that it's impossible to
        tell which names are imported when "from module import *" is done
        with an extension module, short of actually importing it.
        u.iiN(
u
badmodulesuexcludesurfinduappendumodulesugetuNoneuglobalnamesustarimportsusort(uselfumissingumaybeunameuiusubnameupkgnameupkg((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuany_missing_maybe�s0	
	

uModuleFinder.any_missing_maybecCs�tjj|j�}}xD|jD]9\}}|j|�r#||t|�d�}Pq#q#W|jr�||jkr�||kr�|j	dd||f�n|j	dd|f�|jj
|�nt|j�}xMt
t|��D]9}t||t|��r�|j||�||<q�q�Wtj|j|j|j|j|jt|�|j|j||j|j|j|j|j�S(Niuco_filename %r changed to %ru co_filename %r remains unchanged( uosupathunormpathuco_filenameu
replace_pathsu
startswithulenudebuguprocessed_pathsumsgoutuappendulistu	co_constsurangeu
isinstanceutypeureplace_paths_in_codeutypesuCodeTypeuco_argcountu
co_nlocalsuco_stacksizeuco_flagsuco_codeutupleuco_namesuco_varnamesuco_nameuco_firstlinenou	co_lnotabuco_freevarsuco_cellvars(uselfucounew_filenameuoriginal_filenameufuruconstsui((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyureplace_paths_in_code!s*u"ModuleFinder.replace_paths_in_codeNi����i����i����(u__name__u
__module__u__qualname__uNoneu__init__umsgumsginumsgoutu
run_scriptu	load_fileuimport_hookudetermine_parentufind_head_packageu	load_tailuensure_fromlistufind_all_submodulesu
import_moduleuload_moduleu_add_badmoduleu_safe_import_hookustructuunpackuscan_opcodes_25u	scan_codeuload_packageu
add_moduleufind_moduleureportuany_missinguany_missing_maybeureplace_paths_in_code(u
__locals__((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyuModuleFinderDs2	#1".uModuleFindercCsfddl}y)|jtjdd�d�\}}Wn6|jk
rm}zt|�dSWYdd}~XnXd}d}g}g}x�|D]�\}}	|dkr�|d}n|dkr�d}n|dkr�||	jtj�}n|dkrd}n|dkr�|j|	�q�q�W|s0d	}
n
|d}
tj	dd�}tj	j
|
�|d<||}|dkr�td
�x$|D]}tdt|��q�Wnt|||�}
x�|dd�D]z}|dkr�d}q�n|r:|dd�d
kr*|
j
|dd�ddg�qG|
j
|�q�|
j|�q�W|
j|
�|
j�|
S(Niiudmp:qx:u-du-mu-pu-qu-xuhello.pyupath:u   iu.*u*i����i����(ugetoptusysuargvuerroruprintusplituosupathsepuappendupathudirnameurepruModuleFinderuimport_hookuNoneu	load_fileu
run_scriptureport(ugetoptuoptsuargsumsgudebugudomodsuaddpathuexcludeuouauscriptupathuitemumfuarg((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyutest=sX)

			



#

utestu__main__u
[interrupted](u__doc__udisuimpuimportlib.machineryu	importlibumarshaluosusysutypesustructubytesuopnameuindexu
LOAD_CONSTuIMPORT_NAMEu
STORE_NAMEuSTORE_GLOBALu	STORE_OPSu
HAVE_ARGUMENTupackagePathMapuAddPackagePathureplacePackageMapuReplacePackageuModuleuModuleFinderutestu__name__umfuKeyboardInterruptuprint(((u1/opt/alt/python33/lib64/python3.3/modulefinder.pyu<module>s6��;