Ë
    çôf$  ã                   ó¶   — d dl Z d dlZd dlZd dlmZ d dlZddlmZmZ ddlm	Z	 ddl
mZ ddlmZ  ej                  «       Zi Zed„ «       Zd	„ Z G d
„ de«      Zy)é    N)Úcontextmanageré   )Ú
RepositoryÚRepositoryError)ÚPyGIWarning)Úget_introspection_module)Úload_overridesc              #   óè   K  — t         j                  | «      }d–— |ry| dv ryt        j                  | «      �yt         j	                  | «      }t        j                  d| |dœz  t        |¬«       y­w)aO  A 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)ÚGLibÚGObjectÚGioz±%(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ÚgiÚget_required_versionÚget_versionÚwarningsÚwarnr   )r   r   Ú
was_loadedr   s       ú-/usr/lib/python3/dist-packages/gi/importer.pyÚ_check_require_versionr   *   sz   è ø€ ô ×)Ñ)¨)Ó4€Jã	áð 	àÐ.Ñ.àä	×Ñ˜yÓ)Ð5àä×$Ñ$ YÓ/€GÜ‡M�Mð	?ð "¨gÑ
6ñ	7ô 	 
ö,ùs   ‚A0A2c                 óv   — t         j                  dd }|dk  r| rdS dS |dk(  r| rdS dS |dk(  r| rdS dS | rdS dS )	a2  Returns 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   é   )r   r   é   é
   )r   r   )ÚsysÚversion_info)Úimport_hookÚ
py_versions     r   Úget_import_stacklevelr&   Q   sd   € ô ×!Ñ! " 1Ð%€JØ�VÒáˆqÐ& QÐ&Ø	�vÒ	ÙˆqÐ' RÐ'Ø	�vÒ	Ù ˆrÐ' aÐ'ñ  ˆqÐ& QÐ&ó    c                   ó4   — e Zd Zd„ Zd„ Zdd„Zd	d„Zd„ Zd„ Zy)
ÚDynamicImporterc                 ó   — || _         y ©N)Úpath)Úselfr,   s     r   Ú__init__zDynamicImporter.__init__k   s	   € Øˆ�	r'   c                 ó‚   — |j                  | j                  «      sy|j                  dd«      \  }}|| j                  k(  S )NFú.r   )Ú
startswithr,   Úrsplit)r-   Úfullnamer,   r   s       r   Ú_find_module_checkz"DynamicImporter._find_module_checkn   s:   € Ø×"Ñ" 4§9¡9Ô-Øà"Ÿ/™/¨#¨qÓ1‰ˆˆiØ�t—y‘yÑ Ð r'   Nc                 óf   — | j                  |«      r t        j                  j                  || «      S y r+   )r4   Ú	importlibÚutilÚspec_from_loader)r-   r3   r,   Útargets       r   Ú	find_speczDynamicImporter.find_specu   s,   € Ø×"Ñ" 8Ô,Ü—>‘>×2Ñ2°8¸TÓBÐBð -r'   c                 ó*   — | j                  |«      r| S y r+   )r4   )r-   r3   r,   s      r   Úfind_modulezDynamicImporter.find_moduley   s   € Ø×"Ñ" 8Ô,ØˆKð -r'   c                 ó   — |j                   j                  dd«      \  }}t        j                  |«      s#t        j	                  |«      st        d|z  «      ‚t        d¬«      }t        ||¬«      5  	 t        |«      }t        j                  |«      D ],  }t        j                  d|j                  d«      d	   z   «       Œ. t        |«      }d d d «       |S # t        $ r}t        |«      ‚d }~ww xY w# 1 sw Y   S xY w)
Nr0   r   z6cannot import name %s, introspection typelib not foundT)r$   r   zgi.repository.ú-r   )Únamer2   r   r   Úenumerate_versionsÚImportErrorr&   r   r   r   Úget_immediate_dependenciesr6   Úimport_moduleÚsplitr	   )	r-   Úspecr,   r   r   Úintrospection_moduleÚeÚdepÚdynamic_modules	            r   Úcreate_modulezDynamicImporter.create_module}   s  € ØŸ)™)×*Ñ*¨3°Ó2‰ˆˆiô
 ×'Ñ'¨	Ô2Ü×-Ñ-¨iÔ8Üð @ØBKñLó Mð Mô +°tÔ<ˆ
Ü# I¸*ÔEñ 
	Bð%Ü'?À	Ó'JÐ$ô "×<Ñ<¸YÓGò N�Ü×'Ñ'Ð(8¸3¿9¹9ÀS»>È!Ñ;LÑ(LÕMðNä+Ð,@ÓAˆN÷
	Bð Ðøô #ò %Ü! !“nÐ$ûð%ú÷
	Bð Ðús1   Á1C3Á3CÁ>AC3Ã	C0Ã C+Ã+C0Ã0C3Ã3C=c                  ó   — y r+   © )r-   r3   s     r   Úexec_modulezDynamicImporter.exec_module—   s   € àr'   )NNr+   )	Ú__name__Ú
__module__Ú__qualname__r.   r4   r:   r<   rJ   rM   rL   r'   r   r)   r)   g   s!   „ òò!óCóòó4r'   r)   )r"   r   r6   Ú
contextlibr   r   Ú_gir   r   r   Úmoduler   Ú	overridesr	   Úget_defaultr   Úmodulesr   r&   Úobjectr)   rL   r'   r   ú<module>rX      sa   ðó0 Û Û Ý %ã 	ß ,Ý Ý ,Ý %ð $ˆZ×#Ñ#Ó%€
ð €ð ñ#,ó ð#,òL'ô,2�fõ 2r'   