+
    >a                         ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
 ^ RIHtHtHt ^ RIHtHt ^ RIHt ^R	IHtHtHtHtHt  ! R
 R4      tRR lt ! R R4      t ! R R4      t ! R R]4      tR# )    N)count)Optional)AuthenticatorBEGIN)get_bus)MessageMessageTypeParser)	ProxyBase
unwrap_msg)message_bus)MessageFiltersFilterHandleReplyMatcherRouterClosedcheck_replyablec                   t   a  ] tR t^t o RtV 3R lR ltRR/V 3R lR lltV 3R lR	 ltR
 tR t	R t
RtV tR# )DBusConnectiona<  A 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`.
c                N   < V ^8  d   QhRS[ P                  RS[ P                  /# )   readerwriter)asyncioStreamReaderStreamWriter)format__classdict__s   "2lib/python3.14/site-packages/jeepney/io/asyncio.py__annotate__DBusConnection.__annotate__   s'     ( (w33 (W=Q=Q (    c                    Wn         W n        \        4       V n        \	        ^R7      V n        RV n        \        P                  ! 4       V n	        R# )   )startN)
r   r   r
   parserr   outgoing_serialunique_namer   Lock	send_lock)selfr   r   s   &&&r   __init__DBusConnection.__init__   s6    h$1~ r!   serialNc                    < V ^8  d   QhRS[ /# )r   messager   )r   r   s   "r   r   r        s     & &' &r!   c               x  "   V P                   ;_uu_4       GRj  xL
  Vf   \        V P                  4      pV P                  P	                  VP                  V4      4       V P                  P                  4       G Rj  xL
  RRR4      GRj  xL
  R#  L{ L L
  + GRj  xL 
 '       g   i     R# ; i5i)z.Serialise and send a :class:`~.Message` objectN)r)   nextr&   r   write	serialisedrainr*   r/   r-   s   &&$r   sendDBusConnection.send    sq     >>>>~d223KKg//78++##%%%	 ">> &	 ">>>s]   B:BB:A!B BBB:BB:BB:B7	#B&$
B7	/B7	1	B:c                    < V ^8  d   QhRS[ /# r   returnr0   )r   r   s   "r   r   r    (   s     
$ 
$w 
$r!   c                   "    V P                   P                  4       pVe   V# V P                  P                  R4      G Rj  xL
 pV'       g   \        hV P                   P                  V4       Ko   L/5i)z5Return the next available message from the connectionNi   )r%   get_next_messager   readEOFErroradd_data)r*   msgbs   &  r   receiveDBusConnection.receive(   sZ     ++..0C
kk&&t,,AKK  # -s   A A4A2A4$A4c                   "   V P                   P                  4        V P                   P                  4       G Rj  xL
  R#  L5i)zClose the D-Bus connectionN)r   closewait_closedr*   s   &r   rF   DBusConnection.close4   s+     kk%%'''s   8AAAc                   "   V # 5iN rH   s   &r   
__aenter__DBusConnection.__aenter__9   
        c                B   "   V P                  4       G R j  xL
  R #  L5irK   )rF   r*   exc_typeexc_valexc_tbs   &&&&r   	__aexit__DBusConnection.__aexit__<   s     jjls   )r&   r%   r   r)   r'   r   )__name__
__module____qualname____firstlineno____doc__r+   r7   rC   rF   rM   rV   __static_attributes____classdictcell__r   s   @r   r   r      sC     ( (&T & &
$ 
$(
 r!   r   c                  "   \        V 4      p\        P                  ! V4      G Rj  xL
 w  r#\        4       pV Fi  pVP	                  V4       VP                  4       G Rj  xL
  VP                  R4      G Rj  xL
 pV'       g   \        R4      hVP                  V4       Kk  	  VP	                  \        4       VP                  4       G Rj  xL
  \        W#4      p\        V4      ;_uu_4       GRj  xL
 p\        P                  ! \        \        V4      P                  4       ^
4      G Rj  xL
 p	V	^ ,          Vn        RRR4      GRj  xL
  V#  EL/ L L L Lh L/ L  + GRj  xL 
 '       g   i     T# ; i5i)z@Open a plain D-Bus connection

:return: :class:`DBusConnection`
Ni   z#Socket closed before authentication)r   r   open_unix_connectionr   r3   r5   r>   r?   feedr   r   
DBusRouterwait_forProxyr   Hellor'   )
busbus_addrr   r   authrreq_datarB   connrouter
reply_bodys
   &         r   open_dbus_connectionrn   @   s*    
 s|H"77AANF OEXlln++d##@AA

1  LL
,,. &)D $6"++E+v,F,L,L,NPRSS
%a=   K1 B 	#   S   Ks   %FE9F!E"F:E;FAFE&F6E7F:7E%1E!2E%FE#FFFFF!E%#F%E?	+E.,
E?	7E?	9	Fc                      a  ] tR t^`t o RtRtRtRtV 3R lR lt]	R 4       t
RR/R ltV 3R lR	 ltR
RR^/V 3R lR lltR tR tV 3R lR ltR tRtV tR# )rc   zA '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.
Nc                    < V ^8  d   QhRS[ /# )r   rk   )r   )r   r   s   "r   r   DBusRouter.__annotate__j   s     ? ?^ ?r!   c                    Wn         \        4       V n        \        4       V n        \
        P                  ! V P                  4       4      V n        R # rK   )	_connr   _repliesr   _filtersr   create_task	_receiver	_rcv_task)r*   rk   s   &&r   r+   DBusRouter.__init__j   s3    
$&( ,,T^^-=>r!   c                .    V P                   P                  # rK   )rs   r'   rH   s   &r   r'   DBusRouter.unique_namep   s    zz%%%r!   r-   c               Z   "   V P                   P                  WR7      G Rj  xL
  R#  L5i)z&Send a message, don't wait for a replyr-   N)rs   r7   r6   s   &&$r   r7   DBusRouter.sendt   s     jjoogo555s    +)+c                    < V ^8  d   QhRS[ /# r:   r0   )r   r   s   "r   r   rq   x   s     % %7 %r!   c                  "   \        V4       V P                  P                  4       '       d   \        R4      h\	        V P
                  P                  4      pV P                  P                  V\        P                  ! 4       4      ;_uu_ 4       pV P                  WR7      G Rj  xL
  VG Rj  xL
 uuRRR4       #  L L  + '       g   i     R# ; i5i)ztSend a method call message and wait for the reply

Returns the reply message (method return or error message type).
zThis DBusRouter has stoppedr}   N)r   rx   doner   r2   rs   r&   rt   catchr   Futurer7   )r*   r/   r-   	reply_futs   &&  r   send_and_get_replyDBusRouter.send_and_get_replyx   s     
 	 >>  <==djj001]]  )9::i))G)333#O ;:3# ;::sB   BCC%B>&	C/C 0C3C>C CC		Cqueuebufsizec                D   < V ^8  d   QhRS[ S[P                  ,          /# )r   r   )r   r   Queue)r   r   s   "r   r   rq      s      R RXgmm%< Rr!   c               j    \        V P                  Y;'       g    \        P                  ! V4      4      # )a:  Create 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
)r   ru   r   r   )r*   ruler   r   s   &&$$r   filterDBusRouter.filter   s&     DMM41P1P'--:PQQr!   c                   "   V # 5irK   rL   rH   s   &r   rM   DBusRouter.__aenter__   rO   rP   c                x  "   V P                   P                  4       '       d   V P                   P                  4        R# V P                   P                  4        \        P
                  ! \        P                  4      ;_uu_ 4        V P                   G R j  xL
  R R R 4       R#  L  + '       g   i     R# ; i5i)NF)rx   r   resultcancel
contextlibsuppressr   CancelledErrorrR   s   &&&&r   rV   DBusRouter.__aexit__   s{     >>  NN!!#
  NN!!#$$W%;%;<<nn$$ = % =<s0   BB:B&B$B&
B:$B&&B7	1	B:c                    < V ^8  d   QhRS[ /# )r   rA   r0   )r   r   s   "r   r   rq      s     	 	W 	r!   c                   V P                   P                  V4      '       d   R# \        V P                  P	                  V4      4       F  p VP
                  P                  V4       K!  	  R#   \        P                   d     K=  i ; i)zHandle one received messageN)	rt   dispatchlistru   matchesr   
put_nowaitr   	QueueFull)r*   rA   r   s   && r   	_dispatchDBusRouter._dispatch   si    ==!!#&&4==0056F'', 7 $$ s   A--BBc                   "     V P                   P                  4       G Rj  xL
 pV P                  V4       K6   L  T P                  P	                  4        i ; i5i)z'Receiver loop - runs in a separate taskN)rs   rC   r   rt   drop_all)r*   rA   s   & r   rw   DBusRouter._receiver   sF     	% JJ..00s# 1 MM""$s   A< :< AA)rs   ru   rx   rt   )rX   rY   rZ   r[   r\   _nursery_mgr_send_cancel_scope_rcv_cancel_scoper+   propertyr'   r7   r   r   rM   rV   r   rw   r]   r^   r_   s   @r   rc   rc   `   s     
 L? ? & &6D 6% %Rd RA R R	 	% %r!   rc   c                   B   a  ] tR t^t o RtRtRtRR ltR tR t	Rt
V tR# )open_dbus_routerzOpen a D-Bus 'router' to send and receive messages

Use as an async context manager::

    async with open_dbus_router() as router:
        ...
Nc                    Wn         R # rK   )rg   )r*   rg   s   &&r   r+   open_dbus_router.__init__   s    r!   c                   "   \        V P                  4      G R j  xL
 V n        \        V P                  4      V n        V P                  P                  4       G R j  xL
 #  LE L5irK   )rn   rg   rk   rc   req_ctxrM   rH   s   &r   rM   open_dbus_router.__aenter__   sF     .txx88	!$)),\\,,... 9.s"   A%A!A A%A#A%#A%c                   "   V P                   P                  WV4      G R j  xL
  V P                  P                  4       G R j  xL
  R #  L( L5irK   )r   rV   rk   rF   rR   s   &&&&r   rV   open_dbus_router.__aexit__   s<     ll$$X???iioo 	@s!    AA!AAAA)rg   rk   r   SESSION)rX   rY   rZ   r[   r\   rk   r   r+   rM   rV   r]   r^   r_   s   @r   r   r      s*      DG/
   r!   r   c                   B   a a ] tR t^t oRtV 3R ltR tR tRtVt	V ;t
# )re   a  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.
c                2   < \         SV `  V4       W n        R # rK   )superr+   _router)r*   msggenrl   	__class__s   &&&r   r+   Proxy.__init__   s     r!   c                N    R P                  V P                  V P                  4      # )zProxy({}, {}))r   _msggenr   rH   s   &r   __repr__Proxy.__repr__   s    %%dllDLLAAr!   c                   a a VV 3R  lpV# )c                     <"   S! V / VB pVP                   P                  \        P                  J g   Q hSP                  P                  V4      G R j  xL
 p\        V4      #  L5irK   )headermessage_typer	   method_callr   r   r   )argskwargsrA   replymake_msgr*   s   *,  r   inner!Proxy._method_call.<locals>.inner   sZ     D+F+C::**k.E.EEEE,,99#>>Ee$$ ?s   AA&A$A&rL   )r*   r   r   s   ff r   _method_callProxy._method_call   s    	% r!   )r   )rX   rY   rZ   r[   r\   r+   r   r   r]   r^   __classcell__)r   r   s   @@r   re   re      s     	B r!   re   r   )r   r   	itertoolsr   typingr   jeepney.authr   r   jeepney.busr   jeepneyr   r	   r
   jeepney.wrappersr   r   jeepney.bus_messagesr   commonr   r   r   r   r   r   rn   rc   r   re   rL   r!   r   <module>r      sa        -  0 0 2 , 
- -`@V% V%p   0I r!   