o ` @sdZddlZddlmZddlmZmZddlmZm Z m Z m Z ddl m Z ddlmZddlmZdd lmZed d d Gd ddejZGdddeZdddZdS)z*Deprecated: use jeepney.io.asyncio insteadN)warn)Parser MessageType)AuthenticationErrorBEGINmake_auth_external SASLParser)get_bus) message_bus)Router) ProxyBasezOjeepney.integrate.asyncio is deprecated: please use jeepney.io.asyncio instead.) stacklevelc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS) DBusProtocolcCs0t|_t|_ttj|_t|_d|_ dSN) r auth_parserrparserr asyncioFuturerouterauthentication unique_nameselfr;/usr/lib/python3/dist-packages/jeepney/integrate/asyncio.py__init__s    zDBusProtocol.__init__cCs||_|jdtdS)N) transportwriter)rrrrrconnection_madeszDBusProtocol.connection_madecCs2|jt|jd|j|_||jjdS)NT) rrrr set_resultdata_received_post_auth data_receivedrbufferrrrr_authenticateds  zDBusProtocol._authenticatedcCsD|j||jjr|dS|jjr |jt|jjdSdSr)rfeed authenticatedr%errorr set_exceptionr)rdatarrrr#!s  zDBusProtocol.data_receivedcCs"|j|D]}|j|qdSr)rr&rincoming)rr*msgrrrr"(sz$DBusProtocol.data_received_post_authcCs6|js td|j|}|}|j||S)Nz/Wait for authentication before sending messages)rdone RuntimeErrorroutgoing serialiserr)rmessagefuturer*rrr send_message,s   zDBusProtocol.send_messagecs(|jjtjkr td||IdHS)Nz&Only method call messages have replies)header message_typer method_call TypeErrorr3)rr1rrrsend_and_get_reply5szDBusProtocol.send_and_get_replyN) __name__ __module__ __qualname__rr r%r#r"r3r8rrrrrs rcs0eZdZdZfddZddZddZZS)ProxyzAn asyncio proxy for calling D-Bus methods :param msggen: A message generator object. :param DBusProtocol proto: Protocol object to send and receive messages. cst|||_dSr)superr _protocol)rmsggenprotocol __class__rrrAs  zProxy.__init__cCsd|j|jS)Nz Proxy({}, {}))format_msggenr>rrrr__repr__EszProxy.__repr__csfdd}|S)Ncs4|i|}|jjtjusJj|IdHSr)r4r5rr6r>r8)argskwargsr,make_msgrrrinnerIsz!Proxy._method_call..innerr)rrIrJrrHr _method_callHszProxy._method_call)r9r:r;__doc__rrErK __classcell__rrrArr<;s  r<SESSIONcsd|dur t}|jtt|dIdH\}}|jIdHtt|}|IdH}|d|_ ||fS)N)pathr) rget_event_loopcreate_unix_connectionrr rr<r Hellor)buslooptp hello_replyrrrconnect_and_authenticateQs   rX)rNN)rLrwarningsrjeepneyrr jeepney.authrrrr jeepney.busr jeepney.bus_messagesr jeepney.routingr jeepney.wrappersr Protocolrr<rXrrrrs     ,