Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/astroid/brain/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/astroid/brain/__pycache__/brain_gi.cpython-37.pyc

B

��\��@s�dZddlZddlZddlZddlZddlZddlmZmZm	Z	ddl
mZiZdZ
dd�Zdd	�Zd
d�Zdd
�Ze�e�e�e	jee�dS)z�Astroid hooks for the Python 2 GObject introspection bindings.

Helps with understanding everything imported from 'gi.repository'
�N)�MANAGER�AstroidBuildingError�nodes)�AstroidBuilderz^[A-Za-z_]\w*$c
Cs�i}i}i}i}�x
t|�D]�}|�d�r,qt�t|�s:qyt||�}WnwYnXt�|�rl|||<qt�|�s�t�	|�r�|||<qt�
|�s�t�|�r�|||<qt|��d�s�t|��d�s�t|��d�s�t�
|�r�d||<qt|ttf�r�|||<qt|��r|||<qd||<qWd}|�r6|d|j7}xdt|�D]X}|d���rV�q@||}t|�}	t|t��r�dt|��d	d
�}	|d||	f7}�q@W|�r�|d7}|�r�|d
|j7}x&t|�D]}|d|7}|d7}�q�W|�r�|d7}|�r|d|j7}x&t|�D]}|d|7}|d7}�qW|�r>|d7}|�rR|d|j7}x|t|���D]l\}}d}
t|t��r|d}
|d||
f7}t|�}|�s�d}x"|��D]}|d|d7}�q�W|d7}�q`W|S)z`
    Inspect the passed module recursively and build stubs for functions,
    classes, etc.
    �__z<flagsz<enum z<GType r�z# %s constants

z"%s"�\z\\z%s = %s
z

z# %s functions

zdef %s(*args, **kwargs):
z	    pass
z# %s methods

zdef %s(self, *args, **kwargs):
z# %s classes

�object�	Exceptionzclass %s(%s):
zpass
z    �
)�dir�
startswith�re�match�_identifier_re�getattr�inspect�isclass�
isfunction�	isbuiltin�ismethod�ismethoddescriptor�str�isdatadescriptor�
isinstance�int�callable�__name__�sorted�isdigit�replace�items�
issubclassr
�_gi_build_stub�
splitlines)
�parent�classesZ	functions�	constants�methods�name�obj�ret�valZstrval�baseZclassret�line�r/�G/opt/alt/python37/lib/python3.7/site-packages/astroid/brain/brain_gi.pyr#!s�









r#c
Cs^|�d�st|d��|tk�r>|g}g}|dkr<|�d�n|dkrN|�d�y�d}x�t�||�D]�}ytt���by,dd	lm	}m
}t�d
|�t�d
|�Wntk
r�YnXt
|�|ttj|�7}WdQRXWqbtk
r�||kr�YqbXqbWWn"tk
�r"d}t|<YnXtt��||�}|t|<nt|}|dk�rZt|d��|S)Nzgi.repository.)�modnamezgi.repository.GLibzgi._glibzgi.repository.GObjectzgi._gobjectrr)�PyGIDeprecationWarning�PyGIWarning�ignore)r
r�_inspected_modules�append�	itertools�chain�warnings�catch_warnings�gir2r3�simplefilterr
�
__import__r#�sys�modules�ImportErrorrrZstring_build)r1�modnamesZoptional_modnamesZmodcode�mr2r3Zastngr/r/r0�_import_gi_module�sB




 


rCcCs�t|j�dkrdStdd�|jD��s*dS|j}t|tj�rl|jdkrJdSt|jtj	�rh|jj
dkrhdSdSt|tj	�r�|j
dkSdS)N�Fcss|]}t|tj�VqdS)N)rrZConst)�.0�argr/r/r0�	<genexpr>�sz._looks_like_require_version.<locals>.<genexpr>�require_versionr;T)�len�args�all�funcrr�	Attribute�attrname�expr�Namer))�noderLr/r/r0�_looks_like_require_version�s

rRcCsBy(ddl}|�|jdj|jdj�Wntk
r<YnX|S)Nr�)r;rHrJ�valuer
)rQr;r/r/r0�_register_require_version�s rU)�__doc__rr7r>rr9�astroidrrrZastroid.builderrr5rr#rCrRrUZregister_failed_import_hookZregister_transformZCallr/r/r/r0�<module>s b2