
    >a	                         d Z ddlZddlmZ ddlmZmZ ddlmZm	Z	m
Z
mZ ddlmZ ddlmZ ddlmZ dd	lmZ  ed
d            G d dej                  Z G d de          ZddZdS )z*Deprecated: use jeepney.io.asyncio instead    N)warn)ParserMessageType)AuthenticationErrorBEGINmake_auth_external
SASLParser)get_bus)message_bus)Router)	ProxyBasezOjeepney.integrate.asyncio is deprecated: please use jeepney.io.asyncio instead.   )
stacklevelc                   8    e Zd Zd Zd Zd Zd Zd Zd Zd Z	dS )	DBusProtocolc                     t                      | _        t                      | _        t	          t
          j                  | _        t          j                    | _        d | _	        d S N)
r	   auth_parserr   parserr   asyncioFuturerouterauthenticationunique_nameselfs    9lib/python3.11/site-packages/jeepney/integrate/asyncio.py__init__zDBusProtocol.__init__   sH    %<<hhW^,,%n..    c                 f    || _         | j                             dt                      z              d S )N    )	transportwriter   )r   r"   s     r   connection_madezDBusProtocol.connection_made   s1    "U%7%9%99:::::r   c                     | j                             t                     | j                            d           | j        | _        |                     | j        j                   d S )NT)	r"   r#   r   r   
set_resultdata_received_post_authdata_receivedr   bufferr   s    r   _authenticatedzDBusProtocol._authenticated   sZ    U###&&t,,,!94+233333r   c                     | j                             |           | j         j        r|                                  d S | j         j        r3| j                            t          | j         j                             d S d S r   )r   feedauthenticatedr*   errorr   set_exceptionr   )r   datas     r   r(   zDBusProtocol.data_received!   s    d###) 	[!!!!!# 	[--.A$BRBX.Y.YZZZZZ	[ 	[r   c                 t    | j                             |          D ]}| j                            |           d S r   )r   r,   r   incoming)r   r0   msgs      r   r'   z$DBusProtocol.data_received_post_auth(   sD    ;##D)) 	& 	&CK  %%%%	& 	&r   c                     | j                                         st          d          | j                            |          }|                                }| j                            |           |S )Nz/Wait for authentication before sending messages)r   doneRuntimeErrorr   outgoing	serialiser"   r#   )r   messagefuturer0   s       r   send_messagezDBusProtocol.send_message,   sj    "'')) 	RPQQQ%%g..  ""T"""r   c                    K   |j         j        t          j        k    rt	          d          |                     |           d {V S )Nz&Only method call messages have replies)headermessage_typer   method_call	TypeErrorr;   )r   r9   s     r   send_and_get_replyzDBusProtocol.send_and_get_reply5   sN      >&+*AAADEEE&&w/////////r   N)
__name__
__module____qualname__r   r$   r*   r(   r'   r;   rA    r   r   r   r      s             ; ; ;4 4 4[ [ [& & &  0 0 0 0 0r   r   c                   .     e Zd ZdZ fdZd Zd Z xZS )ProxyzAn asyncio proxy for calling D-Bus methods

    :param msggen: A message generator object.
    :param DBusProtocol proto: Protocol object to send and receive messages.
    c                 X    t                                          |           || _        d S r   )superr   	_protocol)r   msggenprotocol	__class__s      r   r   zProxy.__init__A   s&       !r   c                 B    d                     | j        | j                  S )NzProxy({}, {}))format_msggenrJ   r   s    r   __repr__zProxy.__repr__E   s    %%dlDNCCCr   c                       fd}|S )Nc                     K    | i |}|j         j        t          j        u sJ j                            |           d {V S r   )r=   r>   r   r?   rJ   rA   )argskwargsr3   make_msgr   s      r   innerz!Proxy._method_call.<locals>.innerI   s\      (D+F++C:*k.EEEEE::3?????????r   rE   )r   rV   rW   s   `` r   _method_callzProxy._method_callH   s/    	@ 	@ 	@ 	@ 	@ 	@
 r   )rB   rC   rD   __doc__r   rQ   rX   __classcell__)rM   s   @r   rG   rG   ;   sc         
" " " " "D D D      r   rG   SESSIONc                 .  K   |t          j                    }|                    t          t	          |                      d {V \  }}|j         d {V  t          t          |          } |                                  d {V }|d         |_	        ||fS )N)pathr   )
r   get_event_loopcreate_unix_connectionr   r
   r   rG   r   Hellor   )buslooptphello_replys        r   connect_and_authenticaterf   Q   s      |%''..|'#,,.OOOOOOOOFQ


Q

C		######KNAMq6Mr   )r[   N)rY   r   warningsr   jeepneyr   r   jeepney.authr   r   r   r	   jeepney.busr
   jeepney.bus_messagesr   jeepney.routingr   jeepney.wrappersr   Protocolr   rG   rf   rE   r   r   <module>ro      sA   0 0        ' ' ' ' ' ' ' ' S S S S S S S S S S S S       , , , , , , " " " " " " & & & & & &     *0 *0 *0 *0 *07# *0 *0 *0X    I   ,     r   