AlkantarClanX12

Your IP : 3.145.164.47


Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/pkgutil.cpython-37.opt-2.pyc

B

YI~d�S�@stddlmZddlmZddlZddlZddlZddlZddl	Zddl
Z
ddlmZddl
Z
ddddd	d
ddd
dddgZedd�Zde_dd�Zdd�Zd*dd	�Zd+dd
�Zed,dd��Zd-dd�Ze�ejje�dd�ZGdd�d�ZGd d
�d
�Zy.ddlZdd!lmZd.d"d#�Ze�ee�Wne k
�r<YnXd$d�Z!d/d%d�Z"d&d�Z#d'd�Z$d(d�Z%d)d�Z&dS)0�)�
namedtuple)�singledispatchN)�
ModuleType�get_importer�iter_importers�
get_loader�find_loader�
walk_packages�iter_modules�get_data�ImpImporter�	ImpLoader�	read_code�extend_path�
ModuleInfozmodule_finder name ispkgz.A namedtuple with minimal info about a module.cCsLy
|j}Wn4tk
r>|�|�}|dkr0dStj�||�SX||�SdS)N)�	find_spec�AttributeError�find_module�	importlib�util�spec_from_loader)�finder�namer�loader�r�,/opt/alt/python37/lib64/python3.7/pkgutil.py�	_get_specs

rcCs6ddl}|�d�}|tjjkr"dS|�d�|�|�S)Nr��)�marshal�readrr�MAGIC_NUMBER�load)�streamr�magicrrrr(s

�c	#s�ifdd��x�t||�D]�}|V|jryt|j�WnNtk
r\|dk	rX||j�Yqtk
r�|dk	r~||j�n�YqXttj|jdd�p�g}�fdd�|D�}t	||jd|�EdHqWdS)NcSs||krdSd||<dS)NTr)�p�mrrr�seenRszwalk_packages.<locals>.seen�__path__csg|]}�|�s|�qSrr)�.0r&)r(rr�
<listcomp>isz!walk_packages.<locals>.<listcomp>�.)
r
�ispkg�
__import__r�ImportError�	Exception�getattr�sys�modulesr	)�path�prefix�onerror�infor)r(rr	5s ccsz|dkrt�}nt|t�r$td��n
tt|�}i}xB|D]:}x4t||�D]&\}}||krHd||<t|||�VqHWq8WdS)Nz9path must be None or list of paths to look for modules in�)r�
isinstance�str�
ValueError�mapr�iter_importer_modulesr)r4r5Z	importers�yielded�irr-rrrr
ns




cCst|d�sgS|�|�S)Nr
)�hasattrr
)�importerr5rrrr=�s
r=c	cs0|jdkstj�|j�sdSi}ddl}yt�|j�}Wntk
rPg}YnX|��x�|D]�}|�|�}|dks`||kr�q`tj�|j|�}d}|�stj�|��rd|k�r|}yt�|�}	Wntk
r�g}	YnXx&|	D]}|�|�}
|
dkr�d}Pq�Wq`|r`d|kr`d||<|||fVq`WdS)Nr�__init__Fr,Tr8)	r4�os�isdir�inspect�listdir�OSError�sort�
getmodulename�join)rAr5r>rE�	filenames�fn�modnamer4r-�dircontents�subnamerrr�_iter_file_finder_modules�s<





rPc	Cs.t���t�dt�t�d�aWdQRXdS)N�ignore�imp)�warnings�catch_warnings�simplefilter�DeprecationWarningr�
import_modulerRrrrr�_import_imp�s
rXc@s*eZdZd	dd�Zd
dd�Zddd�ZdS)rNcCst�dt�t�||_dS)Nz5This emulation is deprecated, use 'importlib' instead)rS�warnrVrXr4)�selfr4rrrrB�szImpImporter.__init__cCs~|�d�d}||kr$|jdkr$dS|jdkr4d}ntj�|j�g}yt�||�\}}}Wntk
rndSXt||||�S)Nr,���)�splitr4rC�realpathrRrr/r
)rZ�fullnamer4rO�file�filename�etcrrrr�s
zImpImporter.find_moduler%c	cs0|jdkstj�|j�sdSi}ddl}yt�|j�}Wntk
rPg}YnX|��x�|D]�}|�|�}|dks`||kr�q`tj�|j|�}d}|�stj�|��rd|k�r|}yt�|�}	Wntk
r�g}	YnXx&|	D]}|�|�}
|
dkr�d}Pq�Wq`|r`d|kr`d||<|||fVq`WdS)NrrBFr,Tr8)	r4rCrDrErFrGrHrIrJ)rZr5r>rErKrLrMr4r-rNrOrrrr
�s<





zImpImporter.iter_modules)N)N)r%)�__name__�
__module__�__qualname__rBrr
rrrrr�s

c@sjeZdZdZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
ddd�ZdS)r
NcCs.t�dt�t�||_||_||_||_dS)Nz5This emulation is deprecated, use 'importlib' instead)rSrYrVrXr_r`r^ra)rZr^r_r`rarrrrBszImpLoader.__init__cCs:|��zt�||j|j|j�}Wd|jr4|j��X|S)N)�_reopenrR�load_moduler_r`ra�close)rZr^�modrrrrfszImpLoader.load_modulec	Cst|d��
}|��SQRXdS)N�rb)�openr )rZ�pathnamer_rrrr%szImpLoader.get_datacCsT|jrP|jjrP|jd}|tjkr2t|jd�|_n|tjtjfkrPt|jd�|_dS)N��rri)	r_�closedrarR�	PY_SOURCErjr`�PY_COMPILED�C_EXTENSION)rZ�mod_typerrrre)s

zImpLoader._reopencCs0|dkr|j}n||jkr,td|j|f��|S)Nz,Loader for module %s cannot handle module %s)r^r/)rZr^rrr�	_fix_name1s
zImpLoader._fix_namecCs|�|�}|jdtjkS)Nrl)rsrarR�
PKG_DIRECTORY)rZr^rrr�
is_package9s
zImpLoader.is_packagecCs�|�|�}|jdkr�|jd}|tjkrD|�|�}t||jd�|_nJ|tjkrv|�	�zt
|j�|_Wd|j��Xn|tj
kr�|����|_|jS)Nrl�exec)rs�coderarRro�
get_source�compiler`rprerr_rgrt�
_get_delegate�get_code)rZr^rr�sourcerrrr{=s






zImpLoader.get_codec	Cs�|�|�}|jdkr�|jd}|tjkrP|��z|j��|_Wd|j��Xnd|tj	kr�t
j�|j
dd��r�t|j
dd�d��}|��|_WdQRXn|tjkr�|����|_|jS)Nrlr[rm)rsr|rarRrorer_r rgrprCr4�existsr`rjrtrzrx)rZr^rr�frrrrxNs





zImpLoader.get_sourcecCst|j�}t|d�}|jS)NrB)rr`rr)rZr�specrrrrz`s

zImpLoader._get_delegatecCsH|�|�}|jd}|tjkr*|����S|tjtjtjfkrD|j	SdS)Nrl)
rsrarRrtrz�get_filenamerorprqr`)rZr^rrrrrr�es


zImpLoader.get_filename)N)N)N)rbrcrdrwr|rBrfrrersrur{rxrzr�rrrrr
s	

)�zipimporterc	cs�ttj|j�}|j}t|�}i}ddl}x�|D]�}|�|�s@q0||d��t	j
�}t|�dkr�|d�d�r�|d|kr�d||d<||ddfVt|�dkr�q0|�|d�}|dkr�q0|r0d|kr0||kr0d||<||dfVq0WdS)	Nrrlr8z__init__.pyTrBr,F)�sorted�	zipimport�_zip_directory_cache�archiver5�lenrE�
startswithr\rC�seprI)	rAr5Zdirlist�_prefixZplenr>rErLrMrrr�iter_zipimport_modulesss*

r�cCsnytj|}WnZtk
rhxDtjD]6}y||�}tj�||�PWq&tk
rZYq&Xq&Wd}YnX|S)N)r2�path_importer_cache�KeyError�
path_hooks�
setdefaultr/)Z	path_itemrA�	path_hookrrrr�s	

ccs�|�d�rd�|�}t|��d|krV|�d�d}t�|�}t|dd�}|dkrhdSntjEdHtj	}x|D]}t
|�VqnWdS)Nr,z'Relative module name {!r} not supportedrr))r��formatr/�
rpartitionrrWr1r2�	meta_pathr4r)r^�msgZpkg_nameZpkgr4�itemrrrr�s



cCsn|tjkr tj|}|dkr dSt|t�rb|}t|dd�}|dk	rF|St|dd�dkrZdS|j}n|}t|�S)N�
__loader__�__spec__)r2r3r9rr1rbr)Zmodule_or_name�modulerr^rrrr�s


cCs�|�d�rd�|�}t|��ytj�|�}WnFttttfk
rr}z d}t|�|t	|�|��|�Wdd}~XYnX|dk	r�|j
SdS)Nr,z'Relative module name {!r} not supportedz,Error while finding loader for {!r} ({}: {}))r�r�r/rrrr�	TypeErrorr;�typer)r^r�rZexrrrr�s

*cCs�t|t�s|S|d}|dd�}|�d�\}}}|rbytj|j}Wqhttfk
r^|SXntj}�x8|D�].}t|t	�s�qpt
|�}|dk	r�g}	t|d�r�|�|�}
|
dk	r�|
j
p�g}	nt|d�r�|�|�\}}	x|	D]}||kr�|�|�q�Wtj�||�}tj�|�rpyt|�}
Wn8tk
�rT}ztj�d||f�Wdd}~XYqpX|
�@x8|
D]0}|�d�}|�rb|�d��r��qb|�|��qbWWdQRXqpW|S)Nz.pkgr,rrzCan't open %s: %s
�
�#)r9�listr�r2r3r)r�rr4r:rr@r�submodule_search_locationsr�appendrCrJ�isfilerjrG�stderr�write�rstripr�)r4rZ	sname_pkgZparent_package�_Z
final_nameZsearch_path�dirr�portionsrZportionZpkgfiler~r��linerrrr�sP!







cCs�tj�|�}|dkrdS|j}|dks0t|d�s4dStj�|�pJtj�	|�}|dks^t|d�sbdS|�
d�}|�dtj
�|j��tj
j|�}|�|�S)Nr�__file__�/r)rrrrr@r2r3�get�
_bootstrap�_loadr\�insertrCr4�dirnamer�rJr)�package�resourcerrrh�partsZ
resource_namerrrrUs
)Nr%N)Nr%)r%)r%)r%)r%)'�collectionsr�	functoolsrZ
simplegenericr�importlib.utilZimportlib.machineryrCZos.pathr2�typesrrS�__all__r�__doc__rrr	r
r=rP�register�	machinery�
FileFinderrXrr
r�r�r�r/rrrrrrrrrr�<module>sP

9

(Jc

^