????

Your IP : 3.147.67.34


Current Path : /lib/python3.9/site-packages/gi/overrides/__pycache__/
Upload File :
Current File : //lib/python3.9/site-packages/gi/overrides/__pycache__/Gio.cpython-39.pyc

a

��T`YIc@s�ddlZddlmZmZddlmZmZmZddlm	Z	ddl
mZddlm
Z
ddlZe	d�ZgZGd	d
�d
ej�Zee�Ze�d
�d/dd�ZeGd
d�dej��Ze�d�eGdd�dej��Ze�d�eGdd�dej��Ze�d�eGdd�dej��Ze�d�eGdd�dej��Ze�d�eGdd�dej��Ze�d�eGdd�dej��Ze�d�Gdd�dej�Zee�Ze�d�Gdd�dej�Zee�Ze�d�Gdd �d ej�Zee�Ze�d �Gd!d"�d"ej�Zee�Ze�d"�Gd#d$�d$�ZGd%d&�d&ej �Z ee �Z e�d&�Gd'd(�d(ej!�Z!ee!�Z!e�d(�e
j"e
j#e
j$fd)k�rxd*d+�Z%nd,d+�Z%Gd-d.�d.ej&�Z&ee&�Z&e�d.�dS)0�N�)�wakeup_on_signal�register_sigint_fallback)�override�deprecated_init�wrap_list_store_sort_func)�get_introspection_module)�PyGIWarning)�GLib�Gioc@seZdZdd�ZdS)�Applicationc	Os|t|j��^t��8tjj|g|�Ri|��Wd�Wd�S1sP0YWd�n1sn0YdS�N)rZquitrr
r�run)�self�args�kwargs�r�4/usr/lib/python3.9/site-packages/gi/overrides/Gio.pyr
'szApplication.runN)�__name__�
__module__�__qualname__r
rrrrr%srcs��fdd�}|S)Ncsjt�|�j|i|���j�dd�dd�j}�rPtjd|�ftdd�ntjd|ftdd�dS)NZ.����z6%s shouldn't be instantiated directly, use %s instead.r)Z
stacklevelz&%s shouldn't be instantiated directly.)�super�__init__rZrsplitr�warningsZwarnr)rrr�name��cls�insteadrr�new_init3s���z_warn_init.<locals>.new_initr)rrrrrr�
_warn_init1s
r c@seZdZeejd�ZdS)�
VolumeMonitorzGio.VolumeMonitor.get()N)rrrr r
r!rrrrrr!Csr!c@seZdZeej�ZdS)�DBusAnnotationInfoN)rrrr r
r"rrrrrr"Lsr"c@seZdZeej�ZdS)�DBusArgInfoN)rrrr r
r#rrrrrr#Tsr#c@seZdZeej�ZdS)�DBusMethodInfoN)rrrr r
r$rrrrrr$\sr$c@seZdZeej�ZdS)�DBusSignalInfoN)rrrr r
r%rrrrrr%dsr%c@seZdZeej�ZdS)�DBusInterfaceInfoN)rrrr r
r&rrrrrr&lsr&c@seZdZeej�ZdS)�DBusNodeInfoN)rrrr r
r'rrrrrr'tsr'c@seZdZddd�ZdS)�	ActionMapNcsNzt|�Wnty&td��Yn0d��fdd�	}|D]}||�q<dS)a�
        The add_action_entries() method is a convenience function for creating
        multiple Gio.SimpleAction instances and adding them to a Gio.ActionMap.
        Each action is constructed as per one entry.

        :param list entries:
            List of entry tuples for add_action() method. The entry tuple can
            vary in size with the following information:

                * The name of the action. Must be specified.
                * The callback to connect to the "activate" signal of the
                  action. Since GLib 2.40, this can be None for stateful
                  actions, in which case the default handler is used. For
                  boolean-stated actions with no parameter, this is a toggle.
                  For other state types (and parameter type equal to the state
                  type) this will be a function that just calls change_state
                  (which you should provide).
                * The type of the parameter that must be passed to the activate
                  function for this action, given as a single GLib.Variant type
                  string (or None for no parameter)
                * The initial state for this action, given in GLib.Variant text
                  format. The state is parsed with no extra type information, so
                  type tags must be added to the string if they are necessary.
                  Stateless actions should give None here.
                * The callback to connect to the "change-state" signal of the
                  action. All stateful actions should provide a handler here;
                  stateless actions should not.

        :param user_data:
            The user data for signal connections, or None
        zentries must be iterableNcs�|r.tj�|�s td||f��tj�|�}nd}|durttj�d|dd�}tj�	|||�}|dur�|�
d|��n&|dur�td||f��tj||d�}|dur�|�
d|����|�dS)NzfThe type string '%s' given as the parameter type for action '%s' is not a valid GVariant type string. zchange-statezDStateless action '%s' should give None for 'change_state', not '%s'.)r�parameter_type�activate)
r	ZVariantTypeZstring_is_valid�	TypeErrorZnew�VariantZparser
ZSimpleActionZnew_statefulZconnect�
ValueErrorZ
add_action)rr*r)ZstateZchange_stateZvariant_parameterZ
variant_stateZaction�r�	user_datarr�_process_action�s,�
��z5ActionMap.add_action_entries.<locals>._process_action)NNNN)Ziterr+)rZentriesr/r0Zentryrr.r�add_action_entries}s �zActionMap.add_action_entries)N)rrrr1rrrrr(|sr(c@s eZdZdd�Zdd�ZeZdS)�FileEnumeratorcCs|Srr�rrrr�__iter__�szFileEnumerator.__iter__cCs|�d�}|dur|St�dSr)Z	next_fileZ
StopIteration)rZ	file_inforrr�__next__�s
zFileEnumerator.__next__N)rrrr4r5Znextrrrrr2�s	r2c@seZdZdd�ZdS)�MenuItemcCs(|D]\}}}|�|t�||��qdSr)Zset_attribute_valuer	r,)rZ
attributesrZ
format_string�valuerrr�
set_attribute�szMenuItem.set_attributeN)rrrr8rrrrr6�sr6c@s\eZdZdZeejjdd�Zdd�Zdd�Z	dd	�Z
d
d�ZeZdd
�Z
dd�Zdd�ZdS)�Settingsz0Provide dictionary-like access to GLib.Settings.)ZschemaZpathZbackend)Z	arg_namescCs||��vSr��	list_keys�r�keyrrr�__contains__�szSettings.__contains__cCst|���Sr)�lenr;r3rrr�__len__�szSettings.__len__ccs|��D]
}|VqdSrr:r<rrrr4�szSettings.__iter__cCsdS)NTrr3rrr�__bool__�szSettings.__bool__cCs$||vrtd|f��|�|���S)N�unknown key: %r)�KeyErrorZ	get_value�unpackr<rrr�__getitem__szSettings.__getitem__cCs>||vrtd|f��|�|�}|�d���}|�d�}|dkrj|�d���}|�d�s\J�|dd�}n�|dkr�|�d����d�s�J�|�d��d���}|��}||vr�td||f��nf|dk�r|�d�}|�d���}|��\}	}
||	k�s||
k�r&td	||	|
f��ntd
t	|���|�
|t�||��dS)NrBrrZtypeZaZenumz$value %s is not an allowed enum (%s)�rangezvalue %s not in range (%s - %s)z'Cannot handle allowed type range class )
rCZ	get_rangeZget_child_valueZ
get_stringZget_type_stringZ
startswithrDr-ZNotImplementedError�strZ	set_valuer	r,)rr=r7rFZtype_�vZtype_strZallowedZtuple_Zmin_Zmax_rrr�__setitem__s2



�zSettings.__setitem__cCs|��Srr:r3rrr�keys(sz
Settings.keysN)rrr�__doc__rr
r9rr>r@r4rAZ__nonzero__rErIrJrrrrr9�s�!r9c@s4eZdZdZdd�Zdd�Zdd�Zedd	��Zd
S)�_DBusProxyMethodCallz1Helper class to implement DBusProxy method calls.cCs||_||_dSr)�
dbus_proxy�method_name)rrMrNrrrr3sz_DBusProxyMethodCall.__init__c
Csv|\}}}z|�|�}WnFty^t��dd�\}}	|rL|||	|�n|||	|�YdS0|||�|�|�dS)Nr)Zcall_finishZ	Exception�sysZexc_info�_unpack_result)
rZobj�resultr/Zresult_callbackZerror_callbackZreal_user_data�retZetypeZerrrZ__async_result_handler7s
z+_DBusProxyMethodCall.__async_result_handlerc	Os�|r0|d}|dd�}t|t�s4td|��nd}t�|t|��}d|vr�|d|�d�|�d�f}|j�|j	||�dd�|�d	d
�d|j
|�n0|j�|j	||�dd�|�d	d
�d�}|�|�SdS)Nrrz6first argument must be the method signature string: %rz()Zresult_handlerZ
error_handlerr/ZflagsZtimeoutr)
�
isinstancerGr+r	r,ZtupleZgetrMZcallrN�*_DBusProxyMethodCall__async_result_handlerZ	call_syncrP)rrrZ	signatureZarg_variantr/rQrrr�__call__Fs,
��

�z_DBusProxyMethodCall.__call__cCs2|��}t|�dkr|d}nt|�dkr.d}|S)z?Convert a D-BUS return variant into an appropriate return valuerrN)rDr?)ZklassrQrrrrPcs
z#_DBusProxyMethodCall._unpack_resultN)	rrrrKrrTrUZclassmethodrPrrrrrL0srLc@seZdZdZdd�ZdS)�	DBusProxya$Provide comfortable and pythonic method calls.

    This marshalls the method arguments into a GVariant, invokes the
    call_sync() method on the DBusProxy object, and unmarshalls the result
    GVariant back into a Python tuple.

    The first argument always needs to be the D-Bus signature tuple of the
    method call. Example:

      proxy = Gio.DBusProxy.new_sync(...)
      result = proxy.MyMethod('(is)', 42, 'hello')

    The exception are methods which take no arguments, like
    proxy.MyMethod('()'). For these you can omit the signature and just write
    proxy.MyMethod().

    Optional keyword arguments:

    - timeout: timeout for the call in milliseconds (default to D-Bus timeout)

    - flags: Combination of Gio.DBusCallFlags.*

    - result_handler: Do an asynchronous method call and invoke
         result_handler(proxy_object, result, user_data) when it finishes.

    - error_handler: If the asynchronous call raises an exception,
      error_handler(proxy_object, exception, user_data) is called when it
      finishes. If error_handler is not given, result_handler is called with
      the exception object as result instead.

    - user_data: Optional user data to pass to result_handler for
      asynchronous calls.

    Example for asynchronous calls:

      def mymethod_done(proxy, result, user_data):
          if isinstance(result, Exception):
              # handle error
          else:
              # do something with result

      proxy.MyMethod('(is)', 42, 'hello',
          result_handler=mymethod_done, user_data='data')
    cCs
t||�Sr)rL)rrrrr�__getattr__�szDBusProxy.__getattr__N)rrrrKrWrrrrrVss,rVc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�	ListModelcsvt|t�r*�fdd�t|�t����D�St|t�rn|dkrH|t��7}|dkrTt���|�}|durjt�|St�dS)Ncsg|]}��|��qSr)�get_item)Z.0�ir3rrZ
<listcomp>�sz)ListModel.__getitem__.<locals>.<listcomp>r)	rS�slicerF�indicesr?�int�
IndexErrorrYr+)rr=rRrr3rrE�s
 

zListModel.__getitem__cCsD|��j}t||�s(td|j|jf��|D]}||kr,dSq,dS)N�Expected type %s.%sTF)�
get_item_type�pytyperSr+rr)r�itemrarZrrrr>�s

�zListModel.__contains__cCs|��Sr)Zget_n_itemsr3rrrr@�szListModel.__len__ccs"tt|��D]}|�|�VqdSr)rFr?rY)rrZrrrr4�szListModel.__iter__N)rrrrEr>r@r4rrrrrX�s
rX)ri9rcCs,|�||g�t|�D]}|�||�qdSr)�spliceZreversedZinsert)r�position�
n_removals�	additionsrHrrr�_list_store_splice�srgcCs|�|||�dSr)rc)rrdrerfrrrrg�scs8eZdZ�fdd�Z�fdd�Zdd�Zdd�Z�ZS)	�	ListStorecs t|�}tt|�j|g|�R�Sr)rrrh�sort)r�compare_funcr/�Z	__class__rrri�szListStore.sortcs"t|�}tt|�j||g|�R�Sr)rrrh�
insert_sorted)rrbrjr/rkrrrl�s
��zListStore.insert_sortedcCs�t|t�r�|�t|��\}}}|dkr@t||t||d�g�q�|dkrft||dt||d�g�q�tt|||�dd�D]}|�|�qznFt|t	�r�|dkr�|t|�7}|dks�|t|�kr�t
�|�|�nt�dS)NrrrT)Zreverse)rSr[r\r?rg�maxZsortedrFZremover]r^r+)rr=�start�stop�steprZrrr�__delitem__�s

zListStore.__delitem__cCs|t|t�r�|��j}g}|D],}t||�s>td|j|jf��|�|�q|�t	|��\}}}|dkr�t
||t||d�|�nxtt
|||��}	t	|	�t	|�kr�t�|dkr�t
||dt||d�|ddd��n$t|	|�D]\}
}t
||
d|g�q�n~t|t��rt|dk�r|t	|�7}|dk�s4|t	|�k�r8t�|��j}t||��sbtd|j|jf��t
||d|g�nt�dS)Nr_rrr)rSr[r`rar+rr�appendr\r?rgrmZlistrFr-Zzipr]r^)rr=r7raZ	valuelistrHrnrorpr\rZrrrrI�sN


��� �

��zListStore.__setitem__)rrrrirlrqrIZ
__classcell__rrrkrrh�srh)N)'rZ_ossighelperrrZ	overridesrrrZmodulerZgirZ
gi.repositoryr	rOr
Z__all__rrrr r!r"r#r$r%r&r'r(r2r6r9rLrVrXZ
MAJOR_VERSIONZ
MINOR_VERSIONZ
MICRO_VERSIONrgrhrrrrZ<module>st








J


D
C1
#

I