<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
<_1                 @   s   d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm	Z	 d dl
mZmZ d dlmZ eeeZi Zdd ZG d	d
 d
e jZG dd deZdd Zdd ZeZdd Zdd Ze i i edfddZdddZdS )    N)
get_loader)PyGIDeprecationWarning)CallableInfo)	TYPE_NONETYPE_INVALID)extend_pathc                s    fdd}|S )Nc                s    j | _  j| _| S )N)__name__
__module__)wrapper)wrapped  /usr/lib64/python3.6/__init__.pyassign   s    zwraps.<locals>.assignr   )r   r   r   )r   r   wraps   s    r   c                   s8   e Zd ZdZ fddZdd Zdd Zdd	 Z  ZS )
OverridesProxyModulez7Wraps a introspection module and contains all overridesc                s   t t| j|j || _d S )N)superr   __init__r   _introspection_module)selfintrospection_module)	__class__r   r   r   !   s    
zOverridesProxyModule.__init__c             C   s   t | j|S )N)getattrr   )r   namer   r   r   __getattr__&   s    z OverridesProxyModule.__getattr__c             C   s6   t t| j}|j| jj  |jt| j t|S )N)setdirr   update__dict__keysr   sorted)r   resultr   r   r   __dir__)   s    zOverridesProxyModule.__dir__c             C   s   dt | j| jf S )Nz<%s %r>)typer   r   )r   r   r   r   __repr__/   s    zOverridesProxyModule.__repr__)	r   r	   __qualname____doc__r   r   r!   r#   __classcell__r   r   )r   r   r      s
   r   c               @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )_DeprecatedAttributezA 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             C   s$   || _ || _td|||f | _d S )Nz#%s.%s is deprecated; use %s instead)_attr_valuer   _warning)r   	namespaceattrvaluereplacementr   r   r   r   :   s
    z_DeprecatedAttribute.__init__c             C   s(   |d krt | jtj| jdd | jS )N   )
stacklevel)AttributeErrorr(   warningswarnr*   r)   )r   instanceownerr   r   r   __get__A   s    
z_DeprecatedAttribute.__get__c             C   s$   | j }tt|| t||| d S )N)r(   delattrr"   setattr)r   r4   r-   r,   r   r   r   __set__G   s    z_DeprecatedAttribute.__set__c             C   s   t t|| j d S )N)r7   r"   r(   )r   r4   r   r   r   
__delete__M   s    z_DeprecatedAttribute.__delete__N)r   r	   r$   r%   r   r6   r9   r:   r   r   r   r   r'   3   s
   r'   c             C   s  | j jddd }d| }|tjk}tjj|}t|d tfi }|| }|tj|< ddlm} t|dsnt	|||< zHd| }yt
|}	W n tk
r   d	}	Y nX |	d	kr| S tj|}
W d	||= tj|= |r|tj|< X ||_g }t|
d
r|
j}xH|D ]@}yt|
|}W n ttfk
r.    wY nX t|||  qW xptj|g D ]`\}}yt||}W n" tk
r   t	d| Y nX t|| t||||}t||| qPW |S )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.
    .   zgi.repository.ZProxyModuler/   )modulesr   zgi.overrides.N__all__z1%s was set deprecated but wasn't added to __all__)r   rsplitsysr=   getr"   r   ZimporterhasattrAssertionErrorr   r1   	importlibimport_moduleZ_overrides_moduler>   r   	TypeErrorr8   _deprecated_attrspopr7   r'   )r   r+   Z
module_keyZhas_oldZ
old_moduleZ
proxy_typeproxyr=   Zoverride_package_nameZoverride_loaderZoverride_modZoverride_allvaritemr,   r.   r-   deprecated_attrr   r   r   load_overridesR   sX    






rN   c                s   t | tr>| }|jjddd }tjd|    fdd}|S t | tjrXtd|  nyt	| d}W n" t
k
r   td| j Y nX | jjd	std
| | jf |j }|tkst|tkr| |_| jjddd }tjd|   t | j|  | S dS )a  Decorator 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.
    r;   r<   zgi.repository.c                s   t  | j|  | S )N)r8   r   )func)moduler   r   r
      s    zoverride.<locals>.wrapperz"func must be a gi function, got %sZ__info__zKCan not override a type %s, which is not in a gobject introspection typelibzgi.overrideszUYou have tried override outside of the overrides module. This is not allowed (%s, %s)Nr?   r?   )
isinstancer   r	   r@   rA   r=   typesFunctionTyperG   r   r1   r   
startswithKeyErrorZ
get_g_typer   rD   r   Zpytyper8   )Ztype_rO   r+   r
   infoZg_typer   )rP   r   override   s4    
rW   c                s   t   fdd}|S )z7Decorator for marking methods and classes as deprecatedc                 s$   t jd jf tdd  | |S )Nz %s is deprecated; use %s insteadr/   )r0   )r2   r3   r   r   )argskwargs)fnr.   r   r   r      s    
zdeprecated.<locals>.wrapped)r   )rZ   r.   r   r   )rZ   r.   r   
deprecated   s    r[   c             C   s   t j| g j||f dS )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)rH   
setdefaultappend)r+   r,   r.   r   r   r   rM      s    rM   r/   c                s    fdd}|S )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       	         sZ  |r:t jddj dt|  d tt |}ni }|j| g }x4j D ](\}}||krV|j|||< |j	| qVW |rt jddjfddt
|D djt
|f d g }x2j D ]&\}}||krΈ| ||< |j	| qW |r*t jddjfd	dt
|D  d x"D ]}||kr0|j| q0W | f|S )
zInitializer 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/InitializerDeprecationsz, N)r0   zThe keyword(s) "%s" have been deprecated in favor of "%s" respectively. See: https://wiki.gnome.org/PyGObject/InitializerDeprecationsc             3   s   | ]} | V  qd S )Nr   ).0k)deprecated_aliasesr   r   	<genexpr>/  s    z4deprecated_init.<locals>.new_init.<locals>.<genexpr>zInitializer is relying on deprecated non-standard defaults. Please update to explicitly use: %s See: https://wiki.gnome.org/PyGObject/InitializerDeprecationsc             3   s   | ]}d | | f V  qdS )z%s=%sNr   )r^   r_   )deprecated_defaultsr   r   ra   >  s    )r2   r3   joinlendictzipr   itemsrI   r]   r   )	r   rX   rY   Z
new_kwargsZaliases_usedkeyaliasZdefaults_usedr-   )	arg_namescategoryr`   rb   ignorer0   super_init_funcr   r   new_init  s<    





z!deprecated_init.<locals>.new_initr   )rm   rj   rl   r`   rb   rk   r0   rn   r   )rj   rk   r`   rb   rl   r0   rm   r   deprecated_init   s    3ro   c                s   t  fdd}|S )a  Translate 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                 sL   | |}|d r4t |dkr&|d S |dd  S nrD p@dS d S )Nr   r/   r<   zcall failed)rd   )rX   rY   ret)exc_strexc_typefail_retmethodr   r   r   R  s    
z%strip_boolean_result.<locals>.wrapped)r   )rt   rr   rq   rs   r   r   )rq   rr   rs   rt   r   strip_boolean_resultK  s    ru   )NNN)rR   r2   rE   rA   Zpkgutilr   Zgir   Zgi._gir   Zgi._constantsr   r   r   __path__r   rH   r   
ModuleTyper   objectr'   rN   rW   Zoverridefuncr[   rM   tuplero   ru   r   r   r   r   <module>   s.   
V-
Q