
    f&                         S SK r S SKJr  S SKrSSKJrJrJrJrJ	r	J
r
JrJrJrJrJrJrJrJrJrJrJrJrJr  SSKJrJr  SSKJrJrJrJrJ r   \RB                  " 5       r"0 r#S r$S r% " S	 S
\&5      r'S r(g)    N)Lock   )
RepositoryFunctionInfoRegisteredTypeInfoEnumInfo
ObjectInfoInterfaceInfoConstantInfo
StructInfo	UnionInfoCallbackInfoStructBoxedFundamental	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_FLAGSc                    U R                  5       nU(       dj  U R                  5       nU(       a  UR                  (       a  UR                  $ U R                  5       (       a  UR	                  5       (       a  [
        $ [        $ UR                  5       nUR                  5       n[        R                  " SU-   5      n[        XT5      $ Ngi.repository.)
get_parent
get_g_typepytypeget_fundamentalis_instantiatabler   objectget_namespaceget_name	importlibimport_modulegetattr)object_infoparent_object_infogtype	namespacenamemodules         +/usr/lib/python3/dist-packages/gi/module.pyget_parent_for_objectr4   B   s    $//1 &&(U\\<<&&((U-D-D-F-F "002I&&(D$$%5	%ABF6      c                     / nU R                  5        HV  nUR                  5       nUR                  5       n[        R                  " SU-   5      nUR                  [        XT5      5        MX     U$ r    )get_interfacesr(   r)   r*   r+   appendr,   )r-   
interfacesinterface_infor0   r1   r2   s         r3   get_interfaces_for_objectr;   \   sg    J%446"002	&&((()9I)EF'&/0 7 r5   c                   4    \ rS rSrSrS	S jrS rS rS rSr	g)
IntrospectionModuleg   aA  An 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.
Nc                 (   [         R                  X5        Xl        X l        SU-   U l        [         R                  U R                  5      nU/U l        U R                  c$  [         R                  U R                  5      U l        [        5       U l	        g)z"Might raise gi._gi.RepositoryErrorr!   N)

repositoryrequire
_namespace_version__name__get_typelib_path__path__get_versionr   _lock)selfr0   versionpaths       r3   __init__IntrospectionModule.__init__o   sn     	9.#(94**4??;== &224??CDMV
r5   c           
        ^ [         R                  U R                  U5      nU(       d  [        U R                  < SU< 35      e[        U[        5      (       Ga  UR                  5       nU R                     UR                  nUGcC  UR                  5       (       a>  UR                  [        5      (       a  [        U5      nOUU[        :X  d   e[        U5      nO=UR                  [         5      (       a  [#        U5      nOU[        :X  d   e[%        U5      nX$l        SUR)                  5       -   Ul        SR-                  SS5      nUR/                  5        HB  nUR1                  5       R3                  U5      n[5        XGU" UR7                  5       5      5        MD     UR9                  5        H  n[5        XHR                  U5        M     U[        :w  a  XCl	        S S S 5        GO4[        U[:        5      (       Ga  UR                  5       n[        U[<        5      (       a7  [?        U5      m[A        U4S j[C        U5       5       5      n	T4U	-   n
[D        nGO [        U[F        5      (       a  [H        4n
[D        nO[        U[J        5      (       a  [L        4n
[D        nO[        U[N        [P        45      (       a  UR                  [R        5      (       a  [T        4n
OkUR                  [V        5      (       d  U[        :X  d  URX                  U:X  a  [Z        4n
O/[]        SUR)                  5       < SUR_                  5       < 35      e[`        nO[c        U5      eU R                     U[        :w  a-  UR                  nUb  X;  a  XRd                  U'   UsS S S 5        $ USU R                  -   US	.nU" XU5      nU[        :w  a  XCl	        S S S 5        OI[        U[f        5      (       a  UnO1[        U[h        5      (       a  UR7                  5       nO[c        U5      eWU Rd                  U'   U$ ! , (       d  f       N= f! , (       d  f       N0= f)
Nz object has no attribute r!    abcdefgjhijklmnopqrstuvwxyzABCDEFGJHIJKLMNOPQRSTUVWXYZc              3   N   >#    U  H  n[        TU5      (       a  M  Uv   M     g 7fN)
issubclass).0	interfaceparents     r3   	<genexpr>2IntrospectionModule.__getattr__.<locals>.<genexpr>   s%      #I>]*4VY*G $-9>]s   %	%zunable to create a wrapper for .)__info__
__module__	__gtype__)5r@   find_by_namerB   AttributeErrorrD   
isinstancer   r#   rH   r$   is_flagsis_ar   r   r   r   r   r   r   r[   r(   r\   	maketrans
get_valuesget_name_unescaped	translatesetattr	get_valueget_methodsr   r	   r4   tupler;   r   r   r   r
   r   r   r   r   r   r   fundamentalr   	TypeErrorr)   r   NotImplementedError__dict__r   r   )rI   r1   infog_typewrapperascii_upper_trans
value_info
value_namemethod_infor9   bases	metaclasstype_dict_rW   s                 @r3   __getattr__IntrospectionModule.__getattr__   s   &&t= !%"6 7 7 dH%%__&F --?}}!;;z22&/&7G#)Y#66#6&Ft&LG!;;y11&.v&6G#)Y#66#6&Ed&KG'+$)9D<N<N<P)PG&
 )+55)7% '+oo&7
%/%B%B%D%N%NO`%a
WZ=Q=Q=S5TU '8 (,'7'7'9)=)={K (: Y&$+MC F 011__&F $
++.t4" #I>WX\>] #I I
	J.'	D,//"'	D-00#'	D:y"9::;;z**"HEkk,//	)((F2#IE#dN`N`Nbdhdqdqds$tuu&	)$// Y&"MME(U-?.3d+$  !%"2T__"D!'
 $D7 Y&$+M+ . l++Gl++nn&G%d++
 &dE @ s   7E$P*#.P;,P;*
P8;
Q	c                 j    [         R                  U R                  5      nSU R                  < SU< S3$ )Nz<IntrospectionModule z from >)r@   rE   rB   )rI   rK   s     r3   __repr__IntrospectionModule.__repr__   s%    **4??;59__dKKr5   c                    [        [        U R                  5      5      nUR                  U R                  R                  5       5        [        R                  U R                  5      nUR                  S U 5       5        [        U5      $ )Nc              3   p   #    U  H,  n[        U[        5      (       a  M  UR                  5       v   M.     g 7frS   )r`   r   r)   )rU   ro   s     r3   rX   .IntrospectionModule.__dir__.<locals>.<genexpr>   s)      :/$$T<8 &dmmoo/s   66)
setdir	__class__updatern   keysr@   	get_infosrB   list)rI   resultnamespace_infoss      r3   __dir__IntrospectionModule.__dir__   sh    S()dmm((*+ %..t? :/ : 	: F|r5   )rD   rF   rH   rB   rC   rS   )
rD   r\   __qualname____firstlineno____doc__rL   rz   r~   r   __static_attributes__ r5   r3   r=   r=   g   s     kZLr5   r=   c                     U [         ;   a	  [         U    $ [        R                  " U 5      n[        X5      nU[         U '   U$ )zp
:Returns:
    An object directly wrapping the gi module without overrides.

Might raise gi._gi.RepositoryError
)_introspection_modulesgiget_required_versionr=   )r0   rJ   r2   s      r3   get_introspection_moduler      sB     **%i00%%i0G 4F(.9%Mr5   ))r*   	threadingr   r   _gir   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   typesr   r   
_constantsr   r   r   r   r   get_defaultr@   r   r4   r;   r'   r=   r   r   r5   r3   <module>r      ss   .   	     (  ##%
  !4V& Vrr5   