
    f2                        S SK r S SKrS SKrS SKrS SKrS SKJr  S SKJrJ	r	  S SK
JrJr  S SKJr  \" \\5      r0 r " S S\R$                  5      r " S S	\5      rS
 rS r\r S rS r\" 5       0 0 \S4S jrSS jrS rS rg)    N)PyGIDeprecationWarning)CallableInfopygobject_new_full)	TYPE_NONETYPE_INVALID)extend_pathc                   >   ^  \ rS rSrSrU 4S jrS rS rS rSr	U =r
$ )OverridesProxyModule   z7Wraps a introspection module and contains all overridesc                 L   > [         [        U ]  UR                  5        Xl        g N)superr
   __init____name___introspection_module)selfintrospection_module	__class__s     7/usr/lib/python3/dist-packages/gi/overrides/__init__.pyr   OverridesProxyModule.__init__   s"    "D2 ))	+%9"    c                 .    [        U R                  U5      $ r   )getattrr   )r   names     r   __getattr__ OverridesProxyModule.__getattr__   s    t11488r   c                     [        [        U R                  5      5      nUR                  U R                  R                  5       5        UR                  [        U R                  5      5        [        U5      $ r   )setdirr   update__dict__keysr   sorted)r   results     r   __dir__OverridesProxyModule.__dir__!   sO    S()dmm((*+c$4456f~r   c                 R    S[        U 5      R                  < SU R                  < S3$ )N< >)typer   r   )r   s    r   __repr__OverridesProxyModule.__repr__'   s     J//1K1KLLr   )r   )r   
__module____qualname____firstlineno____doc__r   r   r%   r,   __static_attributes____classcell__)r   s   @r   r
   r
      s!    A:
9M Mr   r
   c                   0    \ rS rSrSrS rS rS rS rSr	g)	_DeprecatedAttribute+   zA deprecation descriptor for OverridesProxyModule subclasses.

Emits a PyGIDeprecationWarning on every access and tries to act as a
normal instance attribute (can be replaced and deleted).
c                 T    X l         X0l        [        U< SU< SU< S35      U l        g )N. is deprecated; use  instead)_attr_valuer   _warning)r   	namespaceattrvaluereplacements        r   r   _DeprecatedAttribute.__init__2   s$    
.4./r   c                     Uc  [        U R                  5      e[        R                  " U R                  SS9  U R
                  $ )N   
stacklevel)AttributeErrorr;   warningswarnr=   r<   )r   instanceowners      r   __get___DeprecatedAttribute.__get__9   s3     ,,dmm2{{r   c                 ^    U R                   n[        [        U5      U5        [        XU5        g r   )r;   delattrr+   setattr)r   rJ   r@   r?   s       r   __set___DeprecatedAttribute.__set__?   s#    zzX%&r   c                 B    [        [        U5      U R                  5        g r   )rO   r+   r;   )r   rJ   s     r   
__delete___DeprecatedAttribute.__delete__E   s    X

+r   )r;   r<   r=   N)
r   r.   r/   r0   r1   r   rL   rQ   rT   r2    r   r   r5   r5   +   s    /',r   r5   c                    U R                   R                  SS5      S   nSU-   nU[        R                  ;   n[        R                  R	                  U5      n[        US-   [        40 5      nU" U 5      nU[        R                  U'   SSKJn  [        US5      (       d   eXgU'    S	U-   n[        R                  R                  U5      n	U	b  U	R                  OS
n
U
c0  U Xq	 [        R                  U	 U(       a  U[        R                  U'   $ $ [        R                  " U5      nXq	 [        R                  U	 U(       a  U[        R                  U'   Xfl        / n[        US5      (       a  UR                  nU H  n [!        X5      n['        XmU5        M     [(        R+                  U/ 5       H6  u  nn [!        Xo5      n[/        Xo5        [1        XUU5      n['        X_U5        M8     U$ ! Xq	 [        R                  U	 U(       a  U[        R                  U'   f f = f! ["        [$        4 a     M  f = f! ["         a    [-        SU-  5      ef = f)zLoads overrides for an introspection module.

Either returns the same module again in case there are no overrides or a
proxy module including overrides. Doesn't cache the result.
r8      gi.repository.ProxyModulerD   )modulesr   zgi.overrides.N__all__z1%s was set deprecated but wasn't added to __all__)r   rsplitsysr\   getr+   r
   importerhasattr	importlibutil	find_specloaderimport_module_overrides_moduler]   r   rG   	TypeErrorrP   _deprecated_attrspopAssertionErrorrO   r5   )r   r>   
module_keyhas_old
old_module
proxy_typeproxyr\   override_package_namespecoverride_loaderoverride_modoverride_allvaritemr?   rA   r@   deprecated_attrs                      r   load_overridesrz   J   sU    %--44S!<R@I!I-J CKK'G,J i-/2F1I2NJ+,E#CKK
 #512222I1 /) ;~~''(=>)-)9$++t "'
 KK
#&0CKK
#  !../DE KK
#&0CKK
# $L|Y''#++	<-D 	D!  /229bAk	LE(E 	.UK1
/2 B LK KK
#&0CKK
# " 	* 		  	L CdJL L	Ls0   %9G( G( ;H3H2(0HH/.H/2Ic                   ^ [        U [        5      (       a?  U nUR                  R                  SS5      S   n[        R
                  SU-      mU4S jnU$ [        U [        R                  5      (       a  [        SU -  5      e [        U S5      nU R                  R                  S	5      (       d  [        S
U < SU R                  < S35      eUR                  5       nU[        :w  d   eU[         :w  a  Xl        U R                  R                  SS5      S   n[        R
                  SU-      m[%        TU R                  U 5        U $ ! [         a    [        SU R                  -  5      ef = f)zDecorator for registering an override.

Other than objects added to __all__, these can get referenced in the same
override module via the gi.repository module (get_parent_for_object() does
for example), so they have to be added to the module immediately.
r8   rX   rY   rZ   c                 6   > [        TU R                  U 5        U $ r   )rP   r   )funcmodules    r   wrapperoverride.<locals>.wrapper   s    FDMM40Kr   z"func must be a gi function, got %s__info__zKCan not override a type %s, which is not in a gobject introspection typelibzgi.overrideszNYou have tried override outside of the overrides module. This is not allowed (, ))
isinstancer   r.   r^   r_   r\   typesFunctionTyperi   r   rG   r   
startswithKeyError
get_g_typer   r   pytyperP   )type_r}   r>   r   infog_typer~   s         @r   overrider      s^    %&&OO**3226	-	9:	 	E5--	.	.<uDEE	:5*-D **>::279I9IKL L """"\!!M$$++C3B7	-	9:.'  	:(*/..9: :	:s   E #E+c                 J   ^ ^ [         R                  " T 5      U U4S j5       nU$ )z7Decorator for marking methods and classes as deprecatedc                  l   > [         R                  " TR                  < ST< S3[        SS9  T" U 0 UD6$ )Nr9   r:   rD   rE   )rH   rI   r   r   )argskwargsfnrA   s     r   wrappeddeprecated.<locals>.wrapped   s/    BKKU,	<4"6""r   	functoolswraps)r   rA   r   s   `` r   
deprecatedr      s%    __R# # Nr   c                 P    [         R                  U / 5      R                  X45        g)a  Marks a module level attribute as deprecated. Accessing it will emit
a PyGIDeprecationWarning warning.

e.g. for ``deprecated_attr("GObject", "STATUS_FOO", "GLib.Status.FOO")``
accessing GObject.STATUS_FOO will emit:

    "GObject.STATUS_FOO is deprecated; use GLib.Status.FOO instead"

:param str namespace:
    The namespace of the override this is called in.
:param str namespace:
    The attribute name (which gets added to __all__).
:param str replacement:
    The replacement text which will be included in the warning.
N)rj   
setdefaultappend)r>   r?   rA   s      r   ry   ry      s"    "   B/667JKr   rD   c                 ,   ^ ^^^^^^ UUUUUUU 4S jnU$ )a  Wrapper for deprecating GObject based __init__ methods which specify
defaults already available or non-standard defaults.

:param callable super_init_func:
    Initializer to wrap.
:param list arg_names:
    Ordered argument name list.
:param list ignore:
    List of argument names to ignore when calling the wrapped function.
    This is useful for function which take a non-standard keyword that is munged elsewhere.
:param dict deprecated_aliases:
    Dictionary mapping a keyword alias to the actual g_object_newv keyword.
:param dict deprecated_defaults:
    Dictionary of non-standard defaults that will be used when the
    keyword is not explicitly passed.
:param Exception category:
    Exception category of the error.
:param int stacklevel:
    Stack level for the deprecation passed on to warnings.warn
:returns: Wrapped version of ``super_init_func`` which gives a deprecation
    warning when non-keyword args or aliases are used.
:rtype: callable
c           
      d  > U(       aJ  [         R                  " SSR                  T	S[        U5       5      -  T
TS9  [	        [        T	U5      5      nO0 nUR                  U5        / nTR                  5        H0  u  pVXc;   d  M  UR                  U5      X5'   UR                  U5        M2     U(       aY  [         R                  " SSR                  U4S j[        U5       5       5      < SSR                  [        U5      5      < S3T
TS9  / nTR                  5        H$  u  pXXS;  d  M  TU   X5'   UR                  U5        M&     U(       a;  [         R                  " S	SR                  U4S
 j[        U5       5       5      -  T
TS9  T H  nXS;   d  M
  UR                  U5        M     T" U 40 UD6$ )zvInitializer for a GObject based classes with support for property
sets through the use of explicit keyword arguments.
zUsing positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "%s" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecationsr   NrE   zThe keyword(s) "c              3   .   >#    U  H
  nTU   v   M     g 7fr   rV   ).0kdeprecated_aliasess     r   	<genexpr>4deprecated_init.<locals>.new_init.<locals>.<genexpr>"  s     $YDXq%7%:DXs   z$" have been deprecated in favor of "zM" respectively. See: https://wiki.gnome.org/PyGObject/InitializerDeprecationszInitializer is relying on deprecated non-standard defaults. Please update to explicitly use: %s See: https://wiki.gnome.org/PyGObject/InitializerDeprecationsc              3   :   >#    U  H  o< S TU   < 3v   M     g7f)=NrV   )r   r   deprecated_defaultss     r   r   r   1  s     #iShaq2Ea2H$IShs   )rH   rI   joinlendictzipr    itemsrk   r   r#   )r   r   r   
new_kwargsaliases_usedkeyaliasdefaults_usedr@   	arg_namescategoryr   r   ignorerF   super_init_funcs            r   new_init!deprecated_init.<locals>.new_init  s   
 MM Z ))Ijs4y$9:; #z	;
 c)T23JJ&! ,224JC"",.."7
##C( 5
 MM99$YF<DX$YY99VL%9:< #z	; -335JC$"5c":
$$S) 6
 MM Z ))#iSYZgSh#iij #z	; C s#  t2z22r   rV   )r   r   r   r   r   r   rF   r   s   ``````` r   deprecated_initr      s    <13 13f Or   c                 R   ^ ^^^ [         R                  " T 5      UUUU 4S j5       nU$ )zTranslate method's return value for stripping off success flag.

There are a lot of methods which return a "success" boolean and have
several out arguments. Translate such a method to return the out arguments
on success and None on failure.
c                     > T" U 0 UD6nUS   (       a  [        U5      S:X  a  US   $ USS  $ T(       a  T" T=(       d    S5      eT$ )Nr   rD   rX   zcall failed)r   )r   r   retexc_strexc_typefail_retmethods      r   r   %strip_boolean_result.<locals>.wrappedE  sP    d%f%q63x1}1v12ww7-88Or   r   )r   r   r   r   r   s   ```` r   strip_boolean_resultr   >  s'     __V
 
 Nr   c                    ^  U 4S jnU$ )Nc                 F   > [        U S5      n [        US5      nT" X/UQ76 $ NFr   ab	user_datar}   s      r   wrap'wrap_list_store_sort_func.<locals>.wrapV  +    q%(q%(A%9%%r   rV   r}   r   s   ` r   wrap_list_store_sort_funcr   T      &
 Kr   c                    ^  U 4S jnU$ )Nc                 F   > [        U S5      n [        US5      nT" X/UQ76 $ r   r   r   s      r   r   (wrap_list_store_equal_func.<locals>.wrap`  r   r   rV   r   s   ` r   wrap_list_store_equal_funcr   ^  r   r   )NNN) r   r   rH   rc   r_   gir   gi._gir   r   gi._constantsr   r   pkgutilr   __path__r   rj   
ModuleTyper
   objectr5   rz   r   overridefuncr   ry   tupler   r   r   r   rV   r   r   <module>r      s        
 % 3
  x*  M5++ M*,6 ,>Nb*Z  L( 8=w')r3 Qh,r   