ok

Mini Shell

Direktori : /lib64/python3.6/site-packages/gi/__pycache__/
Upload File :
Current File : //lib64/python3.6/site-packages/gi/__pycache__/module.cpython-36.pyc

3

��<_Q(�@sddlmZddlZddlZddlmZejddkZy
djZWn e	k
r`ddl
mZYnXddlZddlm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZdd	lm Z m!Z!dd
l"m#Z#m$Z$m%Z%m&Z&m'Z'e
j(�Z)iZ*dd�Z+d
d�Z,Gdd�de-�Z.dd�Z/dS)�)�absolute_importN)�Lock��)�	maketrans�)�
Repository�FunctionInfo�RegisteredTypeInfo�EnumInfo�
ObjectInfo�
InterfaceInfo�ConstantInfo�
StructInfo�	UnionInfo�CallbackInfo�Struct�Boxed�	CCallback�enum_add�enum_register_new_gtype_and_add�	flags_add� flags_register_new_gtype_and_add�
GInterface)�GObjectMeta�
StructMeta)�	TYPE_NONE�
TYPE_BOXED�TYPE_POINTER�	TYPE_ENUM�
TYPE_FLAGScCsP|j�}|s(|j�}|r$|jr$|jStS|j�}|j�}tjd|�}t||�S)Nzgi.repository.)	Z
get_parent�
get_g_type�pytype�object�
get_namespace�get_name�	importlib�
import_module�getattr)�object_infoZparent_object_infoZgtype�	namespace�name�module�r-�/usr/lib64/python3.6/module.py�get_parent_for_objectLs
r/cCsHg}x>|j�D]2}|j�}|j�}tjd|�}|jt||��qW|S)Nzgi.repository.)Zget_interfacesr$r%r&r'�appendr()r)�
interfacesZinterface_infor*r+r,r-r-r.�get_interfaces_for_objectcsr2c@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)�IntrospectionModuleaUAn object which wraps an introspection typelib.

    This wrapping creates a python module like representation of the typelib
    using gi repository as a foundation. Accessing attributes of the module
    will dynamically pull them in and create wrappers for the members.
    These members are then cached on this introspection module.
    NcCsltj||�||_||_d||_tj|j�}|g|_trH|jd�g|_|jdkr`tj	|j�|_t
�|_dS)z"Might raise gi._gi.RepositoryErrorzgi.repository.zUTF-8N)�
repositoryZrequire�
_namespaceZ_version�__name__�get_typelib_path�__path__�	_have_py3�decodeZget_versionr�_lock)�selfr*�version�pathr-r-r.�__init__vs

zIntrospectionModule.__init__c
s�tj|j|�}|s$td|j|f��t|t��r<|j�}|j��|j	}|dk�r|j
�r�|jt�rlt
|�}q�|tksxt�t|�}n(|jt�r�t|�}n|tks�t�t|�}||_d|j�|_tdd�}x2|j�D]&}|j�j|�}t||||j���q�Wx |j�D]}t||j|��qW|tk�r.||_	WdQRX�n�t|t��r�|j�}t|t��r�t |��t!�fdd�t"|�D��}	�f|	}
t#}n�t|t$��r�t%f}
t#}n�t|t&��r�t'f}
t#}ntt|t(t)f��r*|jt*��r�t+f}
nB|jt,��s|tk�s|j-|k�rt.f}
nt/d|j�|j0�f��t1}nt2|��|j�f|tk�rl|j	}|dk	�rl||
k�rl||j3|<|S|d|j|d�}
|||
|
�}|tk�r�||_	WdQRXn0t|t4��r�|}nt|t5��r�|j�}nt2|��||j3|<|S)	Nz%r object has no attribute %rzgi.repository.ZabcdefgjhijklmnopqrstuvwxyzZABCDEFGJHIJKLMNOPQRSTUVWXYZc3s|]}t�|�s|VqdS)N)�
issubclass)�.0Z	interface)�parentr-r.�	<genexpr>�sz2IntrospectionModule.__getattr__.<locals>.<genexpr>z$unable to create a wrapper for %s.%s)�__info__�
__module__Z	__gtype__)6r4Zfind_by_namer5�AttributeErrorr6�
isinstancerr!r;r"Zis_flagsZis_ar rr�AssertionErrorrrrrrDr$rErZ
get_valuesZget_name_unescaped�	translate�setattrZ	get_valueZget_methodsr
rr/�tupler2rrrr
rrrrrrZfundamentalr�	TypeErrorr%r�NotImplementedError�__dict__r	r)r<r+�infoZg_type�wrapperZascii_upper_transZ
value_infoZ
value_nameZmethod_infor1�bases�	metaclassZtype_Zdict_r-)rBr.�__getattr__�s�













zIntrospectionModule.__getattr__cCs(tj|j�}tr|jd�}d|j|fS)NzUTF-8z <IntrospectionModule %r from %r>)r4r7r5r9r:)r<r>r-r-r.�__repr__�s
zIntrospectionModule.__repr__cCsFtt|j��}|j|jj��tj|j�}|jdd�|D��t	|�S)Ncss |]}t|t�s|j�VqdS)N)rGrr%)rArOr-r-r.rCsz.IntrospectionModule.__dir__.<locals>.<genexpr>)
�set�dir�	__class__�updaterN�keysr4Z	get_infosr5�list)r<�resultZnamespace_infosr-r-r.�__dir__�s
zIntrospectionModule.__dir__)N)r6rE�__qualname__�__doc__r?rSrTr\r-r-r-r.r3ns

lr3cCs0|tkrt|Stj|�}t||�}|t|<|S)z�
    :Returns:
        An object directly wrapping the gi module without overrides.

    Might raise gi._gi.RepositoryError
    )�_introspection_modules�giZget_required_versionr3)r*r=r,r-r-r.�get_introspection_modules

ra)0Z
__future__r�sysr&Z	threadingr�version_infor9rrF�stringr`Z_girr	r
rrr
rrrrrrrrrrrr�typesrrZ
_constantsrrrrr Zget_defaultr4r_r/r2r#r3rar-r-r-r.�<module>s&
P

Zerion Mini Shell 1.0