HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/gi/overrides/__pycache__/Gio.cpython-38.pyc
U

��	^YJ�@s�ddlZddlmZmZddlmZmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZddlZed
�ZgZGdd�dej�Zee�Ze�d�d3d
d�ZeGdd�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 �d ej�Zee�Ze�d �Gd!d"�d"ej �Z ee �Z e�d"�Gd#d$�d$ej!�Z!ee!�Z!e�d$�Gd%d&�d&�Z"Gd'd(�d(ej#�Z#ee#�Z#e�d(�Gd)d*�d*ej$�Z$ee$�Z$e�d*�d+d,�Z%ej&ej'ej(fd-k�r�d.d/�Z)nd0d/�Z)Gd1d2�d2ej*�Z*ee*�Z*e�d2�dS)4�N�)�wakeup_on_signal�register_sigint_fallback)�override�deprecated_init)�get_introspection_module)�xrange��pygobject_new_full)�PyGIWarning)�GLib�Gioc@seZdZdd�ZdS)�ApplicationcOsTt|j��@t��.tjj|f|�|�W5QR�W5QR�SQRXW5QRXdS�N)r�quitrr
r�run)�self�args�kwargs�r�2/usr/lib/python3/dist-packages/gi/overrides/Gio.pyr)szApplication.runN)�__name__�
__module__�__qualname__rrrrrr'srcs��fdd�}|S)Ncsft�|�j||��j�dd�dd�j}�rLtjd|�ftdd�ntjd|ftdd�dS)N�.����z6%s shouldn't be instantiated directly, use %s instead.r)�
stacklevelz&%s shouldn't be instantiated directly.)�super�__init__r�rsplitr�warnings�warnr)rrr�name��cls�insteadrr�new_init5s���z_warn_init.<locals>.new_initr)r%r&r'rr$r�
_warn_init3s
r(c@seZdZeejd�ZdS)�
VolumeMonitorzGio.VolumeMonitor.get()N)rrrr(r
r)rrrrrr)Esr)c@seZdZeej�ZdS)�DBusAnnotationInfoN)rrrr(r
r*rrrrrr*Nsr*c@seZdZeej�ZdS)�DBusArgInfoN)rrrr(r
r+rrrrrr+Vsr+c@seZdZeej�ZdS)�DBusMethodInfoN)rrrr(r
r,rrrrrr,^sr,c@seZdZeej�ZdS)�DBusSignalInfoN)rrrr(r
r-rrrrrr-fsr-c@seZdZeej�ZdS)�DBusInterfaceInfoN)rrrr(r
r.rrrrrr.nsr.c@seZdZeej�ZdS)�DBusNodeInfoN)rrrr(r
r/rrrrrr/vsr/c@seZdZddd�ZdS)�	ActionMapNcsPzt|�Wntk
r(td��YnXd��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}|dk	rttj�d|dd�}tj�	|||�}|dk	r�|�
d|��n&|dk	r�td||f��tj||d�}|dk	r�|�
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�	TypeError�new�Variant�parser
ZSimpleActionZnew_statefulZconnect�
ValueErrorZ
add_action)r#r2r1�stateZchange_stateZvariant_parameterZ
variant_state�action�r�	user_datarr�_process_action�s,�
��z5ActionMap.add_action_entries.<locals>._process_action)NNNN)�iterr3)r�entriesr;r<�entryrr:r�add_action_entriess �zActionMap.add_action_entries)N)rrrr@rrrrr0~sr0c@s eZdZdd�Zdd�ZeZdS)�FileEnumeratorcCs|Srr�rrrr�__iter__�szFileEnumerator.__iter__cCs|�d�}|dk	r|St�dSr)Z	next_file�
StopIteration)r�	file_inforrr�__next__�s
zFileEnumerator.__next__N)rrrrCrF�nextrrrrrA�s	rAc@seZdZdd�ZdS)�MenuItemcCs(|D]\}}}|�|t�||��qdSr)Zset_attribute_valuerr5)rZ
attributesr#�
format_string�valuerrr�
set_attribute�szMenuItem.set_attributeN)rrrrKrrrrrH�srHc@s\eZdZdZeejjdd�Zdd�Zdd�Z	dd	�Z
d
d�ZeZdd
�Z
dd�Zdd�ZdS)�Settingsz0Provide dictionary-like access to GLib.Settings.)Zschema�pathZbackend)Z	arg_namescCs||��kSr��	list_keys�r�keyrrr�__contains__�szSettings.__contains__cCst|���Sr)�lenrOrBrrr�__len__�szSettings.__len__ccs|��D]
}|VqdSrrNrPrrrrC�szSettings.__iter__cCsdS)NTrrBrrr�__bool__�szSettings.__bool__cCs$||krtd|f��|�|���S)N�unknown key: %r)�KeyErrorZ	get_value�unpackrPrrr�__getitem__szSettings.__getitem__cCs>||krtd|f��|�|�}|�d���}|�d�}|dkrj|�d���}|�d�s\t�|dd�}n�|dkr�|�d����d�s�t�|�d��d���}|��}||kr�td||f��nf|dk�r|�d�}|�d���}|��\}	}
||	k�s||
k�r&td	||	|
f��nt	d
t
|���|�|t�
||��dS)NrVrr�type�a�enumz$value %s is not an allowed enum (%s)�rangezvalue %s not in range (%s - %s)z'Cannot handle allowed type range class )rWZ	get_rangeZget_child_valueZ
get_stringZget_type_string�
startswith�AssertionErrorrXr7�NotImplementedError�strZ	set_valuerr5)rrQrJr]Ztype_�vZtype_strZallowedZtuple_Zmin_Zmax_rrr�__setitem__	s2



�zSettings.__setitem__cCs|��SrrNrBrrr�keys*sz
Settings.keysN)rrr�__doc__rr
rLrrRrTrCrUZ__nonzero__rYrcrdrrrrrL�s�!rLc@s4eZdZdZdd�Zdd�Zdd�Zedd	��Zd
S)�_DBusProxyMethodCallz1Helper class to implement DBusProxy method calls.cCs||_||_dSr)�
dbus_proxy�method_name)rrgrhrrrr5sz_DBusProxyMethodCall.__init__c
Csx|\}}}z|�|�}WnHtk
r`t��dd�\}}	|rN|||	|�n|||	|�YdSX|||�|�|�dS)Nr)Zcall_finish�	Exception�sys�exc_info�_unpack_result)
r�obj�resultr;Zresult_callbackZerror_callbackZreal_user_data�ret�etype�errrZ__async_result_handler9s
z+_DBusProxyMethodCall.__async_result_handlerc	Os�|r0|d}|dd�}t|t�s4td|��nd}t�|t|��}d|kr�|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;�flagsZtimeoutr)
�
isinstancerar3rr5�tuple�getrgZcallrh�*_DBusProxyMethodCall__async_result_handlerZ	call_syncrl)rrrZ	signatureZarg_variantr;rnrrr�__call__Hs2
�

�

�z_DBusProxyMethodCall.__call__cCs2|��}t|�dkr|d}nt|�dkr.d}|S)z?Convert a D-BUS return variant into an appropriate return valuerrN)rXrS)�klassrnrrrrles
z#_DBusProxyMethodCall._unpack_resultN)	rrrrerrvrw�classmethodrlrrrrrf2srfc@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)rf)rr#rrr�__getattr__�szDBusProxy.__getattr__N)rrrrer{rrrrrzus,rzc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�	ListModelcsvt|t�r*�fdd�t|�t����D�St|t�rn|dkrH|t��7}|dkrTt���|�}|dkrjt�|St�dS)Ncsg|]}��|��qSr)�get_item)�.0�irBrr�
<listcomp>�sz)ListModel.__getitem__.<locals>.<listcomp>r)	rs�slicer�indicesrS�int�
IndexErrorr}r3)rrQrorrBrrY�s
 

zListModel.__getitem__cCsD|��j}t||�s(td|j|jf��|D]}||kr,dSq,dS)N�Expected type %s.%sTF)�
get_item_type�pytypersr3rr)r�itemr�rrrrrR�s

�zListModel.__contains__cCs|��Sr)Zget_n_itemsrBrrrrT�szListModel.__len__ccs"tt|��D]}|�|�VqdSr)rrSr})rrrrrrC�szListModel.__iter__N)rrrrYrRrTrCrrrrr|�s
r|cs�fdd�}|S)Ncs$t|d�}t|d�}�||f|��S)NFr	)r[�br;��funcrr�wrap�s

z(_wrap_list_store_sort_func.<locals>.wrapr)r�r�rr�r�_wrap_list_store_sort_func�sr�)r�9rcCs,|�||g�t|�D]}|�||�qdSr)�splice�reversed�insert)r�position�
n_removals�	additionsrbrrr�_list_store_splice�sr�cCs|�|||�dSr)r�)rr�r�r�rrrr��scs8eZdZ�fdd�Z�fdd�Zdd�Zdd�Z�ZS)	�	ListStorecst|�}tt|�j|f|��Sr)r�rr��sort)r�compare_funcr;��	__class__rrr��szListStore.sortcs t|�}tt|�j||f|��Sr)r�rr��
insert_sorted)rr�r�r;r�rrr��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)�reverse)rsr�r�rSr��max�sortedr�remover�r�r3)rrQ�start�stop�steprrrr�__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�r�r3rr�appendr�rSr�r��listrr7�zipr�r�)rrQrJr�Z	valuelistrbr�r�r�r�rrrrrcs^


����

��zListStore.__setitem__)rrrr�r�r�rc�
__classcell__rrr�rr��sr�)N)+r!Z_ossighelperrrZ	overridesrr�modulerZ_compatrZgi._gir
ZgirZ
gi.repositoryrrjr
�__all__rr�r(r)r*r+r,r-r.r/r0rArHrLrfrzr|r�Z
MAJOR_VERSIONZ
MINOR_VERSIONZ
MICRO_VERSIONr�r�rrrr�<module>sz








J


D
C1
#


I