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 :  /usr/lib/python3/dist-packages/jeepney/io/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


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

Current File : /usr/lib/python3/dist-packages/jeepney/io/__pycache__/asyncio.cpython-310.pyc
o

��a��@s�ddlZddlZddlmZddlmZddlmZmZddl	m
Z
ddlmZm
Z
mZddlmZmZddlmZd	d
lmZmZmZmZmZGdd�d�Zddd�ZGdd�d�ZGdd�d�ZGdd�de�ZdS)�N)�count)�Optional)�
Authenticator�BEGIN)�get_bus)�Message�MessageType�Parser)�	ProxyBase�
unwrap_msg)�message_bus�)�MessageFilters�FilterHandle�ReplyMatcher�RouterClosed�check_replyablec@s`eZdZdZdejdejfdd�Zdd�defd	d
�Z	defdd
�Z
dd�Zdd�Zdd�Z
dS)�DBusConnectionaPA plain D-Bus connection with no matching of replies.

    This doesn't run any separate tasks: sending and receiving are done in
    the task that calls those methods. It's suitable for implementing servers:
    several worker tasks can receive requests and send replies.
    For a typical client pattern, see :class:`DBusRouter`.
    �reader�writercCs4||_||_t�|_tdd�|_d|_t��|_	dS)Nr
)�start)
rrr	�parserr�outgoing_serial�unique_name�asyncio�Lock�	send_lock)�selfrr�r�4/usr/lib/python3/dist-packages/jeepney/io/asyncio.py�__init__szDBusConnection.__init__N��serial�messagec	�sv�|j4IdH�&|durt|j�}|j�|�|��|j��IdHWd�IdHdS1IdHs4wYdS)z.Serialise and send a :class:`~.Message` objectN)r�nextrr�write�	serialise�drain�rr#r"rrr�send s�
.�zDBusConnection.send�returnc�sB�	|j��}|dur
|S|j�d�IdH}|st�|j�|�q)z5Return the next available message from the connectionTNi)r�get_next_messager�read�EOFError�add_data)r�msg�brrr�receive(s�
�zDBusConnection.receivec�s �|j��|j��IdHdS)zClose the D-Bus connectionN)r�close�wait_closed�rrrrr24s�
zDBusConnection.closec���|S�Nrr4rrr�
__aenter__9��zDBusConnection.__aenter__c�s�|��IdHdSr6)r2�r�exc_type�exc_val�exc_tbrrr�	__aexit__<s�zDBusConnection.__aexit__)�__name__�
__module__�__qualname__�__doc__r�StreamReader�StreamWriterr rr)r1r2r7r=rrrrrsr�SESSIONc
	�s��t|�}t�|�IdH\}}t�}|D]!}|�|�|��IdH|�d�IdH}|s0td��|�|�q|�t	�|��IdHt
||�}t|�4IdH�}t�t
t|���d�IdH}	|	d|_Wd�IdH|S1IdHstwY|S)zHOpen a plain D-Bus connection

    :return: :class:`DBusConnection`
    Niz#Socket closed before authentication�
r)rr�open_unix_connectionrr%r'r,r-�feedrr�
DBusRouter�wait_for�Proxyr�Hellor)
�bus�bus_addrrr�authr�req_datar0�conn�router�
reply_bodyrrr�open_dbus_connection@s*�


��rSc@s�eZdZdZdZdZdZdefdd�Ze	dd��Z
dd�d	d
�Zdefdd
�Z
ddd�deejfdd�Zdd�Zdd�Zdefdd�Zdd�ZdS)rHz�A 'client' D-Bus connection which can wait for a specific reply.

    This runs a background receiver task, and makes it possible to send a
    request and wait for the relevant reply.
    NrPcCs*||_t�|_t�|_t�|���|_dSr6)	�_connr�_repliesr�_filtersr�create_task�	_receiver�	_rcv_task)rrPrrrr jszDBusRouter.__init__cCs|jjSr6)rTrr4rrrrpszDBusRouter.unique_namer!c�s�|jj||d�IdHdS)z&Send a message, don't wait for a replyr!N)rTr)r(rrrr)ts�zDBusRouter.sendr*c�s|�t|�|j��rtd��t|jj�}|j�|t	�
���}|j||d�IdH|IdHWd�S1s7wYdS)z�Send a method call message and wait for the reply

        Returns the reply message (method return or error message type).
        zThis DBusRouter has stoppedr!N)rrY�donerr$rTrrU�catchr�Futurer))rr#r"�	reply_futrrr�send_and_get_replyxs�
$�zDBusRouter.send_and_get_replyr
)�queue�bufsizer_cCst|j||p
t�|��S)arCreate a filter for incoming messages

        Usage::

            with router.filter(rule) as queue:
                matching_msg = await queue.get()

        :param MatchRule rule: Catch messages matching this rule
        :param asyncio.Queue queue: Send matching messages here
        :param int bufsize: If no queue is passed in, create one with this size
        )rrVr�Queue)r�ruler_r`rrr�filter�szDBusRouter.filterc�r5r6rr4rrrr7�r8zDBusRouter.__aenter__c�sb�|j��r
|j��dS|j��t�tj��|jIdHWd�dS1s*wYdS)NF)rYrZ�result�cancel�
contextlib�suppressr�CancelledErrorr9rrrr=�s�


�
��zDBusRouter.__aexit__r/c	CsN|j�|�rdSt|j�|��D]}z|j�|�Wqtjy$YqwdS)zHandle one received messageN)	rU�dispatch�listrV�matchesr_�
put_nowaitr�	QueueFull)rr/rcrrr�	_dispatch�s��zDBusRouter._dispatchc�s.�z	|j��IdH}|�|�q|j��w)z'Receiver loop - runs in a separate taskTN)rTr1rnrU�drop_all)rr/rrrrX�s�
�zDBusRouter._receiver)r>r?r@rA�_nursery_mgr�_send_cancel_scope�_rcv_cancel_scoperr �propertyrr)rr^rrrarcr7r=rnrXrrrrrH`s
rHc@s2eZdZdZdZdZd
dd�Zdd�Zdd	�ZdS)�open_dbus_routerz�Open a D-Bus 'router' to send and receive messages

    Use as an async context manager::

        async with open_dbus_router() as router:
            ...
    NrDcCs
||_dSr6)rL)rrLrrrr �s
zopen_dbus_router.__init__c�s0�t|j�IdH|_t|j�|_|j��IdHSr6)rSrLrPrH�req_ctxr7r4rrrr7�s�zopen_dbus_router.__aenter__c�s,�|j�|||�IdH|j��IdHdSr6)rur=rPr2r9rrrr=�s�zopen_dbus_router.__aexit__�rD)	r>r?r@rArPrur r7r=rrrrrt�s
rtcs0eZdZdZ�fdd�Zdd�Zdd�Z�ZS)rJa�An asyncio proxy for calling D-Bus methods

    You can call methods on the proxy object, such as ``await 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.

    :param msggen: A message generator object.
    :param ~asyncio.DBusRouter router: Router to send and receive messages.
    cst��|�||_dSr6)�superr �_router)r�msggenrQ��	__class__rrr �s
zProxy.__init__cCsd�|j|j�S)Nz
Proxy({}, {}))�format�_msggenrxr4rrr�__repr__�szProxy.__repr__cs��fdd�}|S)Nc�s<��|i|��}|jjtjusJ��j�|�IdH}t|�Sr6)�header�message_typer�method_callrxr^r)�args�kwargsr/�reply��make_msgrrr�inner�s
�z!Proxy._method_call.<locals>.innerr)rr�r�rr�r�_method_call�szProxy._method_call)r>r?r@rAr r~r��
__classcell__rrrzrrJ�s

rJrv)rrf�	itertoolsr�typingr�jeepney.authrr�jeepney.busr�jeepneyrrr	�jeepney.wrappersr
r�jeepney.bus_messagesr�commonrrrrrrrSrHrtrJrrrr�<module>s
0 X

Anon7 - 2022
AnonSec Team