AlkantarClanX12

Your IP : 18.119.143.45


Current Path : /usr/lib64/python3.6/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/__pycache__/modulefinder.cpython-36.opt-2.pyc

3


 \�Y�@sddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	e	j
��e	jde�ddl
Z
WdQRXejdZejdZejdZejdZeefZejZiZdd�ZiZd	d
�ZGdd�d�ZGd
d�d�Zdd�Zedk�ry
e�ZWnek
�red�YnXdS)�N�ignore�
LOAD_CONST�IMPORT_NAME�
STORE_NAME�STORE_GLOBALcCstj|g�j|�dS)N)�packagePathMap�
setdefault�append)Zpackagename�path�r�$/usr/lib64/python3.6/modulefinder.py�AddPackagePath sr
cCs|t|<dS)N)�replacePackageMap)Zoldname�newnamerrr�ReplacePackage+src@seZdZddd�Zdd�ZdS)�ModuleNcCs(||_||_||_d|_i|_i|_dS)N)�__name__�__file__�__path__�__code__�globalnames�starimports)�self�name�filer
rrr�__init__1szModule.__init__cCsLd|jf}|jdk	r&|d|jf}|jdk	r@|d|jf}|d}|S)Nz	Module(%rz, %r�))rrr)r�srrr�__repr__>s

zModule.__repr__)NN)r�
__module__�__qualname__rrrrrrr/s

rc@s�eZdZddggfdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zd7dd�Z	d9dd�Z
dd�Zdd�Zd:dd�Z
dd�Zdd�Zdd�Zd d!�Zd<d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd=d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)>�ModuleFinderNrcCsB|dkrtj}||_i|_i|_||_d|_||_||_g|_dS)Nr)	�sysr
�modules�
badmodules�debug�indent�excludes�
replace_paths�processed_paths)rr
r%r'r(rrrrIszModuleFinder.__init__cGs^||jkrZxt|j�D]}tddd�qWt|dd�x|D]}tt|�dd�q<Wt�dS)Nz   � )�end)r%�ranger&�print�repr)r�level�str�args�i�argrrr�msgUs

zModuleFinder.msgcGs,|d}||jkr(|jd|_|j|�dS)Nr�)r%r&r4)rr1r/rrr�msgin^s
zModuleFinder.msgincGs,|d}||jkr(|jd|_|j|�dS)Nrr5)r%r&r4)rr1r/rrr�msgoutds
zModuleFinder.msgoutcCsB|jdd|�t|��"}ddtjf}|jd|||�WdQRXdS)N��
run_script��r�__main__)r4�open�imp�	PY_SOURCE�load_module)r�pathname�fp�stuffrrrr9js
zModuleFinder.run_scriptcCsTtjj|�\}}tjj|�\}}t|��"}|dtjf}|j||||�WdQRXdS)Nr;)�osr
�split�splitextr=r>r?r@)rrA�dirrZextrBrCrrr�	load_fileps

zModuleFinder.load_filer5c	Cs\|jdd||||�|j||d�}|j||�\}}|j||�}|sF|S|jrX|j||�dS)N��import_hook)r/)r4�determine_parent�find_head_package�	load_tailr�ensure_fromlist)	rr�caller�fromlistr/�parent�q�tail�mrrrrJwszModuleFinder.import_hookcCs(|jdd||�|s|dkr.|jdd�dS|j}|dkr�|jrJ|d8}|dkrn|j|}|jdd|�|S|jd�|kr�td��dj|jd�d|��}|j|}|jdd|�|S|jr�|j|}|jdd|�|Sd|k�r|j	d�}|d|�}|j|}|jdd|�|S|jdd�dS)	N�rKrzdetermine_parent -> Noner5zdetermine_parent ->�.zrelative importpath too deep)
r6r7rrr#�count�ImportError�joinrE�rfind)rrOr/ZpnamerQr2rrrrK�s<





zModuleFinder.determine_parentcCs�|jdd||�d|kr@|jd�}|d|�}||dd�}n|}d}|r\d|j|f}n|}|j|||�}|r�|jdd||f�||fS|r�|}d}|j|||�}|r�|jdd||f�||fS|jdd|�td	|��dS)
NrUrLrVr5r:z%s.%szfind_head_package ->z"raise ImportError: No module namedzNo module named )r6�findr�
import_moduler7rX)rrQrr2�headrSZqnamerRrrrrL�s.
zModuleFinder.find_head_packagecCs�|jdd||�|}xz|r�|jd�}|dkr4t|�}|d|�||dd�}}d|j|f}|j|||�}|s|jdd|�td|��qW|jdd	|�|S)
NrUrMrVrr5z%s.%sz"raise ImportError: No module namedzNo module named zload_tail ->)r6r[�lenrr\r7rX)rrRrSrTr2r]ZmnamerrrrM�s
zModuleFinder.load_tailcCs�|jdd|||�xl|D]d}|dkrF|s||j|�}|r||j||d�qt||�sd|j|f}|j|||�}|std|��qWdS)NrUrN�*r5z%s.%szNo module named )r4�find_all_submodulesrN�hasattrrr\rX)rrTrP�	recursive�sub�all�subnameZsubmodrrrrN�s


zModuleFinder.ensure_fromlistc
Cs�|js
dSi}g}|tjjdd�7}|tjjdd�7}|tjjdd�7}x�|jD]�}ytj|�}Wn$tk
r�|j	dd|�wVYnXx\|D]T}d}x6|D].}t
|�}	||	d�|kr�|d|	�}Pq�W|r�|dkr�|||<q�WqVW|j�S)Nr8zcan't list directoryr)r�	importlib�	machinery�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXESrD�listdir�OSErrorr4r^�keys)
rrTr#�suffixesrG�namesr�modZsuff�nrrrr`�s.

z ModuleFinder.find_all_submodulescCs|jdd|||�y|j|}Wntk
r4YnX|jdd|�|S||jkrb|jdd�dS|r�|jdkr�|jdd�dSy|j||o�|j|�\}}}Wn"tk
r�|jddd�dSXz|j||||�}Wd|r�|j	�X|r�t
|||�|jdd|�|S)NrIr\zimport_module ->zimport_module -> None)r6r#�KeyErrorr7r$r�find_modulerXr@�close�setattr)rZpartname�fqnamerQrTrBrArCrrrr\�s6

zModuleFinder.import_modulecCs|\}}}|jdd||od|�|tjkrH|j||�}|jdd|�|S|tjkrht|j�d|d�}	nj|tjkr�yt	j
j|j��}
Wn:tk
r�}z|jddt
|�|��WYdd}~XnXtj|
�}	nd}	|j|�}||_|	�r
|jr�|j|	�}	|	|_|j|	|�|jdd|�|S)Nr8r@rBzload_module ->�
�execzraise ImportError: )r6r>Z
PKG_DIRECTORY�load_packager7r?�compile�readZPY_COMPILEDrf�_bootstrap_external�_validate_bytecode_headerrXr0�marshal�loads�
add_modulerr(�replace_paths_in_coder�	scan_code)rrvrBrA�	file_info�suffix�mode�typerT�coZmarshal_data�excrrrr@s2





zModuleFinder.load_modulecCs<||jkri|j|<|r*d|j||j<nd|j|d<dS)Nr5�-)r$r)rrrOrrr�_add_badmodule4s


zModuleFinder._add_badmodulecCs||jkr|j||�dSy|j|||d�Wn@tk
rn}z$|jddt|��|j||�WYdd}~Xn�X|�rx�|D]�}||jkr�|j||�q|y|j|||g|d�Wq|tk
r�}z0|jddt|��|d|}|j||�WYdd}~Xq|Xq|WdS)N)r/r8zImportError:rV)r$r�rJrXr4r0)rrrOrPr/r4rc�fullnamerrr�_safe_import_hook<s&


zModuleFinder._safe_import_hookccs�|j}|j}|j}dd�tj|�D�}x�t|�D]�\}\}}|tkrVd||ffVq0|tkr0|dkr0||dd||ddko�tknr0|||dd}	|||dd}
|	dkr�d|
||ffVq0d|	|
||ffVq0q0WdS)	NcSs"g|]\}}}|tkr||f�qSr)�EXTENDED_ARG)�.0�_�opr3rrr�
<listcomp>Xsz-ModuleFinder.scan_opcodes.<locals>.<listcomp>�storer8r5r�absolute_import�relative_import)	�co_code�co_names�	co_consts�disZ_unpack_opargs�	enumerate�	STORE_OPSrr)rr��codero�constsZopargsr2r�Zopargr/rPrrr�scan_opcodesSs 0zModuleFinder.scan_opcodescCs�|j}|j}�xT||�D�]F\}}|dkr<|\}d|j|<q|dk�r|\}}d}	|dk	rtd|krfd}	dd�|D�}|j|||dd�|	�r`d}
|jr�|jj|jd	|�}
|
dkr�|jj|�}
|
dk	r�|jj|
j�|j	j|
j	�|
j
dkr�d|j	|<n
d|j	|<q|d
k�rX|\}}}|�r4|j||||d�n"|j||d�}|j|jd|dd�qt|��qWx,|j
D]"}
t|
t|���rl|j|
|��qlWdS)Nr�r5r�rr_cSsg|]}|dkr|�qS)r_r)r��frrrr�usz*ModuleFinder.scan_code.<locals>.<listcomp>)r/rVr�)r�r�rr�rr#�getr�updaterrrK�RuntimeErrorr��
isinstancer�r�)rr�rTr��scannerZwhatr1rrPZ	have_starZmmr/rQ�crrrr�hsH



zModuleFinder.scan_codecCs�|jdd||�tj|�}|r"|}|j|�}||_|g|_|jtj|g�|_|jd|j�\}}}z"|j||||�|j	dd|�|S|r�|j
�XdS)Nr8ryrzload_package ->)r6rr�r�rrrrsr@r7rt)rrvrArrTrBZbufrCrrrry�s

zModuleFinder.load_packagecCs*||jkr|j|St|�|j|<}|S)N)r#r)rrvrTrrrr��s

zModuleFinder.add_modulecCsr|dk	r|jd|}n|}||jkr<|jdd|�t|��|dkrf|tjkr`ddddtjffS|j}tj	||�S)NrVrIzfind_module -> Excludedr:)
rr'r7rXr"�builtin_module_namesr>Z	C_BUILTINr
rs)rrr
rQr�rrrrs�s

zModuleFinder.find_modulecCs"t�tdd�tdd�t|jj��}xJ|D]B}|j|}|jrTtddd�ntddd�td	||jppd
�q2W|j�\}}|r�t�td�x2|D]*}t|j|j��}td|d
dj|��q�W|�rt�tddd�td�x2|D]*}t|j|j��}td|d
dj|��q�WdS)Nz
  %-25s %s�Name�File�----�Pr*)r+rTz%-25sr:zMissing modules:�?z
imported fromz, z7Submodules that appear to be missing, but could also bez#global names in the parent package:)r�r�)r�r�)	r-�sortedr#rmrr�any_missing_mayber$rY)rrm�keyrT�missing�mayberZmodsrrr�report�s0



zModuleFinder.reportcCs|j�\}}||S)N)r�)rr�r�rrr�any_missing�szModuleFinder.any_missingcCs�g}g}x�|jD]�}||jkr q|jd�}|dkr>|j|�q||dd�}|d|�}|jj|�}|dk	r�||j|kr�|j|�q�||jkr�q�|jr�|j|�q�|j|�q|j|�qW|j�|j�||fS)NrVrr5)	r$r'rZr	r#r�rr�sort)rr�r�rr2reZpkgnameZpkgrrrr��s0	



zModuleFinder.any_missing_maybecCstjj|j�}}x2|jD](\}}|j|�r||t|�d�}PqW|jr�||jkr�||krt|j	dd||f�n|j	dd|f�|jj
|�t|j�}x8t
t|��D](}t||t|��r�|j||�||<q�Wtj|j|j|j|j|j|jt|�|j|j||j|j|j|j|j �S)Nr8zco_filename %r changed to %rz co_filename %r remains unchanged)!rDr
�normpath�co_filenamer(�
startswithr^r%r)r7r	�listr�r,r�r�r��types�CodeType�co_argcount�co_kwonlyargcount�
co_nlocals�co_stacksize�co_flagsr��tupler��co_varnames�co_name�co_firstlineno�	co_lnotab�co_freevars�co_cellvars)rr�Znew_filenameZoriginal_filenamer�r;r�r2rrrr�s,



z"ModuleFinder.replace_paths_in_code���)NNr�r�)r�)rr�)r�)N)rrr rr4r6r7r9rHrJrKrLrMrNr`r\r@r�r�r�r�ryr�rsr�r�r�r�rrrrr!Gs2	

#

1
".r!cCs�ddl}y|jtjdd�d�\}}Wn*|jk
rP}zt|�dSd}~XnXd}d}g}g}xb|D]Z\}}	|dkr�|d}|dkr�d}|dkr�||	jtj�}|dkr�d}|dkrh|j|	�qhW|s�d	}
n|d}
tj	dd�}tj	j
|
�|d<||}|dk�r.td
�x|D]}tdt|���qWt|||�}
xp|dd�D]`}|dk�r^d}�qH|�r�|dd�d
k�r�|
j
|dd�ddg�n
|
j
|�n
|
j|��qHW|
j|
�|
j�|
S)Nrr5zdmp:qx:z-dz-mz-pz-qz-xzhello.pyzpath:z   r8z.*r_���r�)�getoptr"�argv�errorr-rErD�pathsepr	r
�dirnamer.r!rJrHr9r�)r�Zoptsr1r4r%ZdomodsZaddpathZexclude�o�aZscriptr
�item�mfr3rrr�test:sX



r�r<z
[interrupted]) r�Zimportlib._bootstrap_externalrf�importlib.machineryr~rDr"r�Zstruct�warnings�catch_warnings�simplefilter�DeprecationWarningr>Zopmaprrrrr�r�rr
rrrr!r�rr��KeyboardInterruptr-rrrr�<module>s@




v;