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__/importer.cpython-38.pyc
U

��	^��@s�ddlmZddlZddlZddlZddlmZddlZddlm	Z	m
Z
ddlmZddlm
Z
ddlmZe	��ZiZed	d
��Zdd�ZGd
d�de�ZdS)�)�absolute_importN)�contextmanager�)�
Repository�RepositoryError)�PyGIWarning)�get_introspection_module)�load_overridesccs^t�|�}dV|rdS|dkr$dSt�|�dk	r6dSt�|�}tjd||d�t|d�dS)aOA context manager which tries to give helpful warnings
    about missing gi.require_version() which could potentially
    break code if only an older version than expected is installed
    or a new version gets introduced.

    ::

        with _check_require_version("Gtk", stacklevel):
            load_namespace_and_overrides()
    N)ZGLibZGObjectZGioz�%(namespace)s was imported without specifying a version first. Use gi.require_version('%(namespace)s', '%(version)s') before import to ensure that the right version gets loaded.)�	namespace�version��
stacklevel)�
repository�
is_registered�giZget_required_versionZget_version�warnings�warnr)r
r
Z
was_loadedr�r�-/usr/lib/python3/dist-packages/gi/importer.py�_check_require_version+s 

��rcCsZtjdd�}|dkr"|rdSdS|dkr6|r2dSdS|dkrJ|rFdSdS|rRdSdSdS)	a2Returns the stacklevel value for warnings.warn() for when the warning
    gets emitted by an imported module, but the warning should point at the
    code doing the import.

    Pass import_hook=True if the warning gets generated by an import hook
    (warn() gets called in load_module(), see PEP302)
    N�)�r�)rr��
)rr)�sys�version_info)�import_hookZ
py_versionrrr�get_import_stacklevelRs	rc@s&eZdZdd�Zddd�Zdd�ZdS)	�DynamicImportercCs
||_dS)N)�path)�selfr rrr�__init__lszDynamicImporter.__init__NcCs2|�|j�sdS|�dd�\}}||jkr.dS|S)N�.r)�
startswithr �rsplit)r!�fullnamer r
rrr�find_moduleos
zDynamicImporter.find_modulec	Cs�|tjkrtj|S|�dd�\}}t�|�sDt�|�sDtd|��tdd�}t||d��nzt	|�}Wn*t
k
r�}zt|��W5d}~XYnXt�|�D]}t�
d|�d�d	�q�t|�}W5QRXd
||_||_|tj|<|S)Nr#rz6cannot import name %s, introspection typelib not foundT)rrzgi.repository.�-rz<%s>)r�modulesr%rrZenumerate_versions�ImportErrorrrrrZget_immediate_dependencies�	importlib�
import_module�splitr	�__file__�
__loader__)	r!r&r r
r
Zintrospection_module�eZdepZdynamic_modulerrr�load_moduleys,


��


zDynamicImporter.load_module)N)�__name__�
__module__�__qualname__r"r'r1rrrrrhs

r)Z
__future__rrrr+�
contextlibrrZ_girrr�modulerZ	overridesr	Zget_defaultrr)rr�objectrrrrr�<module>s
&