HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/thread-self/root/lib/python3/dist-packages/gi/__pycache__/module.cpython-38.pyc
U

��	^�%�@s�ddlmZddlZz
djZWn ek
r>ddlmZYnXddlZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZddlmZmZddlmZmZm Z m!Z!m"Z"e�#�Z$iZ%d	d
�Z&dd�Z'Gd
d�de(�Z)dd�Z*dS)�)�absolute_importN�)�	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|��}|s(|��}|r$|jr$|jStS|��}|��}t�d|�}t||�S�N�gi.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/lib/python3/dist-packages/gi/module.py�get_parent_for_objectHs
r/cCsDg}|��D]2}|��}|��}t�d|�}|�t||��q|Sr)Zget_interfacesr$r%r&r'�appendr()r)�
interfacesZinterface_infor*r+r,r-r-r.�get_interfaces_for_object_sr2c@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.
    NcCsRt�||�||_||_d||_t�|j�}|g|_|jdkrNt�|j�|_dS)z"Might raise gi._gi.RepositoryErrorr N)�
repositoryZrequire�
_namespaceZ_version�__name__�get_typelib_path�__path__Zget_version)�selfr*�version�pathr-r-r.�__init__rs

zIntrospectionModule.__init__cs�t�|j|�}|s$td|j|f��t|t��r |��}|j}|dk�r|�	�rz|�
t�rdt|�}q�|t
kspt�t|�}n(|�
t�r�t|�}n|t
ks�t�t|�}||_d|��|_tdd�}|��D]&}|���|�}t||||����q�|��D]}t||j|�q�|t
k�r�||_�n�t|t��rx|��}t|t��rrt|��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|�
t)��r�t*f}
nB|�
t+��s�|t
k�s�|j,|k�r�t-f}
nt.d|��|�/�f��t0}nt1|��|t
k�rH|j}|dk	�rH||
k�rH||j2|<|S|d|j|d�}
|||
|
�}|t
k�r�||_n0t|t3��r�|}nt|t4��r�|��}nt1|��||j2|<|S)	Nz%r object has no attribute %rr ZabcdefgjhijklmnopqrstuvwxyzZABCDEFGJHIJKLMNOPQRSTUVWXYZc3s|]}t�|�s|VqdS�N)�
issubclass)�.0Z	interface��parentr-r.�	<genexpr>�s
�z2IntrospectionModule.__getattr__.<locals>.<genexpr>z$unable to create a wrapper for %s.%s)�__info__�
__module__Z	__gtype__)5r4Zfind_by_namer5�AttributeErrorr6�
isinstancer	r!r"Zis_flagsZis_arrr�AssertionErrorrrrrrCr$rDrZ
get_valuesZget_name_unescaped�	translate�setattrZ	get_valueZget_methodsrr
r/�tupler2rrrrrr
rrrrZfundamentalr�	TypeErrorr%r�NotImplementedError�__dict__rr)r9r+�infoZg_type�wrapperZascii_upper_transZ
value_infoZ
value_nameZmethod_infor1�bases�	metaclassZtype_Zdict_r-r@r.�__getattr__�s��





�


��

�


zIntrospectionModule.__getattr__cCst�|j�}d|j|fS)Nz <IntrospectionModule %r from %r>)r4r7r5)r9r;r-r-r.�__repr__�szIntrospectionModule.__repr__cCsFtt|j��}|�|j���t�|j�}|�dd�|D��t	|�S)Ncss |]}t|t�s|��VqdSr=)rFrr%)r?rNr-r-r.rB�s
�z.IntrospectionModule.__dir__.<locals>.<genexpr>)
�set�dir�	__class__�updaterM�keysr4Z	get_infosr5�list)r9�resultZnamespace_infosr-r-r.�__dir__�s
zIntrospectionModule.__dir__)N)r6rD�__qualname__�__doc__r<rRrSr[r-r-r-r.r3js

jr3cCs0|tkrt|St�|�}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

r`)+Z
__future__rr&rrE�stringr_Z_girrrr	r
rrr
rrrrrrrrrr�typesrrZ
_constantsrrrrrZget_defaultr4r^r/r2r#r3r`r-r-r-r.�<module>s 
P