+
    >a.                        R t ^ RIt^ RIHt ^ RIHt ^ RIt^ RIHt ^ RI	t	^ RI
HtHt ^ RIt^ RIt^ RIHt ^ RIHtHtHtHt ^ RIHtHt ^ R	IHt ^ R
IHtHt ^ RIHtH t  ^ RI!H"t" ^ RI#H$t$ ^RI%H&t&H't'H(t( . R Ot) ! R R4      t*R t+R t, ! R R4      t- ! R R]-4      t. ! R R]4      t/R t0R!R R llt1R"R R llt2]3R8X  d   ]2! 4       t4]5! R]4Pl                  4       R# R# )#z'Synchronous IO wrappers around jeepney
N)deque)
ECONNRESET)count)DefaultSelector
EVENT_READ)Optional)ParserMessageMessageTypeHeaderFields)AuthenticatorBEGIN)get_bus)FileDescriptorfds_buf_size)	ProxyBase
unwrap_msg)Router)message_bus)MessageFiltersFilterHandlecheck_replyableDBusConnectionProxyc                   >   a  ] tR t^t o R tR tR tR tR tRt	V t
R# )_Futurec                    R V n         R # N_resultselfs   &3lib/python3.14/site-packages/jeepney/io/blocking.py__init___Future.__init__   s	        c                ,    \        V P                  4      # r   )boolr   r    s   &r"   done_Future.done"   s    DLL!!r%   c                    R V3V n         R# FNr   )r!   	exceptions   &&r"   set_exception_Future.set_exception%   s    y)r%   c                    R V3V n         R# )TNr   )r!   results   &&r"   
set_result_Future.set_result(   s    f~r%   c                6    V P                   w  rV'       d   V# Vhr   r   )r!   successvalues   &  r"   r0   _Future.result+   s    Lr%   r   N)__name__
__module____qualname____firstlineno__r#   r(   r-   r1   r0   __static_attributes____classdictcell____classdict__s   @r"   r   r      s#     "*& r%   r   c                 F    V e   \         P                  ! 4       V ,           # R # r   )time	monotonictimeouts   &r"   timeout_to_deadlinerD   2   s    ~~'))r%   c                 Z    V e'   \        V \        P                  ! 4       ,
          R4      # R # )Ng        )maxr@   rA   )deadlines   &r"   deadline_to_timeoutrH   7   s$    8dnn..33r%   c                   z   a  ] tR t^=t o RtRV 3R lR lltR tR tV 3R lR ltR t	R	 t
RR ltR tR tRtV tR
# )DBusConnectionBasez8Connection machinery shared by this module and threadingc                4   < V ^8  d   QhRS[ P                   /#    socksocket)formatr>   s   "r"   __annotate__DBusConnectionBase.__annotate__?   s        V]]  r%   c                    Wn         W n        \        4       V n        \	        ^R7      V n        \        4       V n        V P                  P                  V\        4      V n
        RV n        R# )   )startN)rN   
enable_fdsr   parserr   outgoing_serialr   selectorregisterr   
select_keyunique_name)r!   rN   rW   s   &&&r"   r#   DBusConnectionBase.__init__?   sK    	$h$1~')--00zBr%   c                    V # r    r    s   &r"   	__enter__DBusConnectionBase.__enter__H   s    r%   c                &    V P                  4        R # F)close)r!   exc_typeexc_valexc_tbs   &&&&r"   __exit__DBusConnectionBase.__exit__K   s    

r%   c                P   < V ^8  d   QhRS[ RS[S[S[P                  ,          3/# )rM   messagereturn)r	   bytesr   array)rQ   r>   s   "r"   rR   rS   O   s)      ' uhu{{>S6T r%   c                    Vf   \        V P                  4      pV P                  '       d   \        P                  ! R4      MR pVP	                  W#R7      pWC3# )Ni)serialfds)nextrY   rW   ro   	serialise)r!   rl   rr   rs   datas   &&&  r"   
_serialiseDBusConnectionBase._serialiseO   sJ    >$../F"&///ekk#t   8yr%   c                    V P                   P                  V.\        P                  \        P                  V3.4      pV\        V4      8  d    V P                   P                  WR  4       R # R # r   )rN   sendmsgrP   
SOL_SOCKET
SCM_RIGHTSlensendall)r!   rv   rs   
bytes_sents   &&& r"   _send_with_fds!DBusConnectionBase._send_with_fdsV   s]    YY&&Ff''):):C@A


 D	!IId;/0 "r%   c                     V P                   P                  4       pVe   V# V P                  \        V4      R7      w  r4V P                   P	                  W4R7       K\  )TrB   )rs   )rX   get_next_message_read_some_datarH   add_data)r!   rG   msgbrs   s   &&   r"   _receiveDBusConnectionBase._receive_   sQ    ++..0C
))2Eh2O)PFAKK   ,r%   Nc                   V P                   P                  V4       Fa  w  r#W P                  8X  g   K  V P                  '       d   V P	                  4       u # \        V P                  P                  R 4      4      . 3u # 	  \        h)i   )	rZ   selectr\   rW   _read_with_fdsunwrap_readrN   recvTimeoutError)r!   rC   keyevs   &&  r"   r   "DBusConnectionBase._read_some_datah   sd    }}++G4GCoo%???..00&tyy~~d';<b@@ 5 r%   c                8   V P                   P                  4       pV P                  P                  V\	        4       4      w  r#rEV\        \        R ^ 4      ,          '       d   V P                  4        \        R4      h\        V4      \        P                  ! V4      3# )
MSG_CTRUNCz&Unable to receive all file descriptors)rX   bytes_desiredrN   recvmsgr   getattrrP   re   RuntimeErrorr   r   from_ancdata)r!   nbytesrv   ancdataflags_s   &     r"   r   !DBusConnectionBase._read_with_fdsr   su    **,"&))"3"3FLN"Ku76<333JJLGHH4 ."="=g"FFFr%   c                n    V P                   P                  4        V P                  P                  4        R# )zClose the connectionN)rZ   re   rN   r    s   &r"   re   DBusConnectionBase.closez   s     		r%   )rW   rY   rX   r\   rZ   rN   r]   rd   r   )r7   r8   r9   r:   __doc__r#   ra   ri   rw   r   r   r   r   re   r;   r<   r=   s   @r"   rJ   rJ   =   sE     B    1-G r%   rJ   c                      a a ] tR t^t oRV3R lV 3R llltRV3R lR llt]tRR/V3R lR lltRR/R	 ltRRR
R/R lt	RRR^/V3R lR llt
RR/V3R lR lltRtVtV ;t# )r   c                4   < V ^8  d   QhRS[ P                   /# rL   rO   )rQ   r>   s   "r"   rR   DBusConnection.__annotate__   s     * *V]] *r%   c                   < \         SV `  W4       R V n        \        \        4      V n        \        4       V n        \        \        V 4      V n
        V P                  P                  4       pV^ ,          V n        R# r+   )superr#   _unwrap_replyr   r   routerr   _filtersr   r   	bus_proxyHellor]   )r!   rN   rW   hello_reply	__class__s   &&& r"   r#   DBusConnection.__init__   s]    *" Wo&( {D1nn**,&q>r%   Nc                    < V ^8  d   QhRS[ /# )rM   rl   r	   )rQ   r>   s   "r"   rR   r      s     $ $G $r%   c                    V P                  W4      w  r4V'       d   V P                  W44       R# V P                  P                  V4       R# )z.Serialise and send a :class:`~.Message` objectN)rw   r   rN   r~   )r!   rl   rr   rv   rs   s   &&&  r"   sendDBusConnection.send   s5    OOG4	*IId#r%   rC   c                    < V ^8  d   QhRS[ /# rM   rm   r   )rQ   r>   s   "r"   rR   r      s     ; ;' ;r%   c               6    V P                  \        V4      4      # )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.
)r   rD   )r!   rC   s   &$r"   receiveDBusConnection.receive   s     }}09::r%   c                   V P                  VR7      pV P                  P                  V4       V P                  P	                  V4       F  pVP
                  P                  V4       K   	  R# )zLReceive one message and apply filters

See :meth:`filter`. Returns nothing.
rB   N)r   r   incomingr   matchesqueueappend)r!   rC   r   filters   &$  r"   recv_messagesDBusConnection.recv_messages   sQ    
 ll7l+S!mm++C0FLL$ 1r%   unwrapc               &   \        V4       \        V4      pVf   V P                  p\        V P                  4      pV P                  WR7        V P                  \        V4      R7      pVP                  P                  P                  \        P                  R4      pWu8X  d   V'       d   \        V4      # V# V P                  P                  V4       V P                   P#                  V4       F  pVP$                  P'                  V4       K   	  K  )zSend a message, wait for the reply and return it

Filters are applied to other messages received before the reply -
see :meth:`add_filter`.
)rr   rB   )r   rD   r   rt   rY   send_messager   rH   headerfieldsgetr   reply_serialr   r   r   r   r   r   r   )	r!   rl   rC   r   rG   rr   msg_inreply_tor   s	   &&$$     r"   send_and_get_reply!DBusConnection.send_and_get_reply   s     	 &w/>''Fd**+'1\\*=h*G\HF}}++//0I0I2NH!%f-- KK  (--//7##F+ 8r%   r   bufsizec                0   < V ^8  d   QhRS[ S[,          /# )rM   r   )r   r   )rQ   r>   s   "r"   rR   r      s     8 8Xe_ 8r%   c               N    Vf   \        VR7      p\        V P                  W4      # )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
)maxlen)r   r   r   )r!   ruler   r   s   &&$$r"   r   DBusConnection.filter   s$     =)EDMM477r%   c                    < V ^8  d   QhRS[ /# r   r   )rQ   r>   s   "r"   rR   r      s      W r%   c                   \        V4      p\        V4      ^ 8X  d   V P                  \        V4      R7       K-  VP	                  4       # )a
  Process 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
rB   )rD   r}   r   rH   popleft)r!   r   rC   rG   s   &&$ r"   recv_until_filtered"DBusConnection.recv_until_filtered   s<      'w/%jAo':8'DE}}r%   )r   r   r   r   r]   rd   r   )r7   r8   r9   r:   r#   r   r   r   r   r   r   r   r;   r<   __classcell__r   r>   s   @@r"   r   r      s~     * *$ $ L; ; ;%t %,T ,$ ,68d 8A 8 8"D   r%   c                   J   a a ] tR t^t oRtRR/V 3R lltR tR tRtVt	V ;t
# )r   a6  A 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
rC   Nc               >   < \         SV `  V4       W n        W0n        R # r   )r   r#   _connection_timeout)r!   msggen
connectionrC   r   s   &&&$r"   r#   Proxy.__init__   s     %r%   c                ~    V P                   f   RMRV P                    2pRV P                   RV P                   V R2# )N z
, timeout=zProxy(z, ))r   _msggenr   )r!   extras   & r"   __repr__Proxy.__repr__  sA    }},Z3O~R(8(8'9%BBr%   c                J   a a \         P                  ! S4      VV 3R  l4       pV# )c                     < VP                  R SP                  4      pS! V / VB pVP                  P                  \        P
                  J g   Q hSP                  P                  W2RR7      # )r   T)rC   r   )popr   r   message_typer
   method_callr   r   )argskwargsrC   r   make_msgr!   s   *,  r"   inner!Proxy._method_call.<locals>.inner	  sg    jjT]];GD+F+C::**k.E.EEEE##66T 7  r%   )	functoolswraps)r!   r   r   s   ff r"   _method_callProxy._method_call  s%    		"	 
#	 r%   )r   r   )r7   r8   r9   r:   r   r#   r   r   r;   r<   r   r   s   @@r"   r   r      s&     " d  
C
 
r%   c                f    V '       g)   \        \        \        P                  ! \        4      4      hV # )zRaise 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)r   s   &r"   r   r     s"     ":r{{:/FGGHr%   c                8    V ^8  d   QhR\         P                   /# r   rO   )rQ   s   "r"   rR   rR      s       r%   c           	     2  aa \         P                   ! \         P                  R7      o\        V4      oVV3R lp V! SP                  V 4       \	        VR7      pV FA  pV! SP
                  V4       VP                  \        V! SP                  R4      4      4       KC  	  V! SP
                  \        4       SP                  R4       S#   \         P                   d&   pSP                  4        \        RT R24      ThRp?i SP                  4        h ; i)z=Create a socket and authenticate ready to send D-Bus messages)familyc                 D   < SP                  \        S4      4       V ! V!  # r   )
settimeoutrH   )methr   rG   rN   s   &*r"   with_sock_deadline'prep_socket.<locals>.with_sock_deadline(  s    +H56T{r%   )rW   i   zDid not authenticate in z secondsN)rP   AF_UNIXrD   connectr   r~   feedr   r   r   rC   re   r   r   )	addrrW   rC   r   authrreq_dataerG   rN   s	   &&&    @@r"   prep_socketr	     s    ==/D
 #7+H4<<.4Ht||X6JJ{#5dii#FGH  	4<</ 	OODK >> P

5gYhGHaO

s   A=C D  D  Dc                $    V ^8  d   QhR\         /# r   )r   )rQ   s   "r"   rR   rR   >  s      r%   c                L    \        V 4      p\        W1VR7      p\        WA4      pV# )a  Connect 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.
rB   )r   r	  r   )busrW   auth_timeoutbus_addrrN   conns   &&&   r"   open_dbus_connectionr  >  s(     s|Hx\BD$+DKr%   __main__zUnique name:)r  r   r   )Fg       @)SESSIONFg      ?)7r   ro   collectionsr   errnor   r   	itertoolsr   r   	selectorsr   r   rP   r@   typingr   jeepneyr   r	   r
   r   jeepney.authr   r   jeepney.busr   jeepney.fdsr   r   jeepney.wrappersr   r   jeepney.routingr   jeepney.bus_messagesr   commonr   r   r   __all__r   rD   rH   rJ   r   r   r   r	  r  r7   r  printr]   r`   r%   r"   <module>r"     s         	 1    > > -  4 2 " , A A (
@ @Fj' jZ%I %P<* z!D	.$**+ r%   