+
    iOT  c                   s    ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHu Ht ^ RI	H
t
 ^ RIHtHtHt ^RIHtHt ]P$                  ! ]4      t ! R R4      tR t ! R R	]4      tR# )
i    N)systemd_ctypes)BusBusErrorintrospection)ChannelChannelErrorc                   sX   a  ] tR t^gt o R tV 3R lR ltR tR
R ltR tR
R lt	R	t
V tR# )InterfaceCachec                s2    / V n         \        4       V n        R # N)cacheZsetoldselfs   &:/usr/lib/python3.14/site-packages/cockpit/channels/dbus.py__init__ZInterfaceCache.__init__h   s    
5    c                s   < V ^8  d   QhRR/# i   ZreturnN )format__classdict__s   "r   __annotate__ZInterfaceCache.__annotate__l   s     & &D &r   c                s<    V P                   P                  V4       R # r   )r   update)r   
interfaces   &&r   injectZInterfaceCache.injectl   s    

*%r   c                s.  "   VP                  W#R R4      G Rj  xL
 w  p\        P                  ! V4      pVP                  R4       Uu/ uF*  qfP                  R,          \
        P                  ! V4      bK,  	  ppV P                  V4       V#  Ltu upi 5i)z#org.freedesktop.DBus.IntrospectableZ
IntrospectN	interfacename)call_method_asyncETZ
fromstringZfindallZattribr   Zparse_interfacer   )r   busdestinationobject_pathZxmlZetZtagr   s   &&&&    r   introspect_pathZInterfaceCache.introspect_patho   s     **;+P+79 9 ]]3XZXbXbcnXopXoQTjj(-*G*G*LLXo
p 	J9 qs!   BB/B	0B9BBNc                s  "    V P                   V,          #   \         d     Mi ; iT'       d7   T'       d/    T P                  Y#T4      G R j  xL 
  M  \         d     Mi ; iT P                   P	                  T4      # 5ir   )r   KeyErrorr   r   getr   interface_namer   r   r      &&&&&r   get_interfaceZInterfaceCache.get_interface}   st     	::n-- 		 ;**3[III  zz~~n--sT   B B%B%
BBA AA BA# B"A##Bc                s   "   WP                   9   d   R # V P                   P                  V4       V P                  WW44      G R j  xL
 #  L5ir   )r	   Zaddr%   r"   r$   r   get_interface_if_newZ#InterfaceCache.get_interface_if_new   s;     XX%^$''[VVVVs   AAA
Ac                s   "   V P                  WWE4      G R j  xL
 pVf   \        RV R24      hRP                  VR,          V,          R,          4      #  L=5i)Nz
Interface z is not found ZmethodsZin)r%   r    join)r   r#   methodr   r   r   r   s   &&&&&& r   get_signatureZInterfaceCache.get_signature   sY     ,,^+[[	Z'7}EFFwwy+F3D9::	 \s   AA>A)r   r	   )NNN)__name__
__module____qualname____firstlineno__r   r   r   r%   r&   r*   __static_attributes____classdictcell__r      @r   r   r   g   s.     & &.W; ;r   r   c                 s    VP                  4        UUu/ uF  w  rEWEP                  bK  	  uppV P                  V/ 4      V&   R # u uppi r   )itemsvalueZ
setdefault)notifypathr#   propsZkZvs   &&&&  r   notify_updater8      s9    JO++-2X-$!1gg:-2XFdB/2Xs   Ac                   s   a  ] tR t^t o ]P
                  ! ^R7      tRtRtRt	Rt
RtR tR tR tR tR tR	 tR
 tR tR tR tR tR tRtV tR# )DBusChannel)Zindentz
dbus-json3Nc           
     s  a a"   V 3R  loV3R lpS P                  VRRRRS P                  R7        S P                  P                  RRRRRS P                  4      G Rj  xL
 w  pS! V4       R#  L  \         d   pTP                  R	8X  d    S P                  P                  RRRR
RS P                  ^ 4      G Rj  xL 
   Rp?R#   \         dM   p\
        P                  RS P                  TP                  4       S P                  RR7        Rp? Rp?R# Rp?ii ; i\
        P                  RS P                  TP                  4        Rp?R# Rp?ii ; i5i)c                 s`   < SP                   V 8w  d   V Sn         SP                  V R 7       R# R# )ownerN)r;   	send_json)r;   r      &r   
send_ownerZ9DBusChannel.setup_name_owner_tracking.<locals>.send_owner   s+     zzU""
U+ #r   c                 sR   < V P                  4       w  rpS! VR 8w  d   TMRR7       R# )r'   Nr:   )get_body)messageZ_nameZ_oldnewr>   s   &   r   handlerZ6DBusChannel.setup_name_owner_tracking.<locals>.handler   s&    &//1EC2IS48r   zorg.freedesktop.DBusz/org/freedesktop/DBusZNameOwnerChanged)senderr6   r   memberZarg0ZGetNameOwnersNz)org.freedesktop.DBus.Error.NameHasNoOwnerZStartServiceByNameZsuz Failed to start service '%s': %sr:   z'Failed to get owner of service '%s': %s)	add_signal_handlerr   r   r   r   loggerdebugr@   r<   )r   rB   unique_nameerrorZstart_errorr>   s   f    @r   setup_name_owner_trackingZ%DBusChannel.setup_name_owner_tracking   sA    	,	9 	'=%<*@'9%)YY 	  	0	$!%!;!;<R<S<R<JCQUQZQZ"\ \LK( {#)\  	bzzHH/((445K5L5K5I4QUQZQZ\]_ _ _   /LL!CTYYP[PcPcdNNN../ F		SXS`S`aa	bs|   .E-A3  A1!A3 '
E1A3 3E>E.C
>C?C
E
D!=DEED!!.EEEEc                s  a  \        4       S n        VP                  R 4      S n        . S n        VP                  R4      pVP                  R4      p Ved   Ve   VR8w  d   \        RRR7      h\        P                  RVS P                  4       \        P                  ! VS P                  RJR	7      S n
        MVR
8X  dG   \        P                  RS P                  4       S P                  P                  P                  S n
        MVR8X  d<   \        P                  RS P                  4       \        P                  ! 4       S n
        MWVR8X  g   Vf<   \        P                  RS P                  4       \        P                  ! 4       S n
        M\        RRV R2R7      h S P                  P#                  R^ 4       \(        P*                  ! 4       S n        S P                  e"   R V 3R llpS P/                  V! 4       4       R# S P1                  4        R#   \          d   p\        RRT RT 2R7      ThRp?ii ; i  \          d+   pTP$                  \$        P&                  8w  d   h  Rp?LRp?ii ; i)r   r   addressNZnonezprotocol-errorz0only one of "bus" and "address" can be specified)r@   zget bus with address %s for %s)rL   Z
bus_clientZinternalzget internal bus for %sZsessionzget session bus for %sZsystemzget system bus for %szinvalid bus "Z"zfailed to connect to z bus: c                s    V ^8  d   QhRR/# r   r   )r   s   "r   r   Z)DBusChannel.do_open.<locals>.__annotate__   s     = =T =r   c                  sd  <"   S P                   ;_uu_4       GR j  xL
  S P                  4       G R j  xL
  S P                  '       d   S P                  S P                  R7       MS P	                  RR/4       R R R 4      GR j  xL
  R #  Lp LZ L
  + GR j  xL 
 '       g   i     R # ; i5i)N)rI   Zproblemz	not-found)watch_processing_lockrK   r;   readycloser
   s   r   	get_readyZ&DBusChannel.do_open.<locals>.get_ready   so     555588:::zzz

tzz
:

I{#;< 655: 6555s`   B0BB0BBB0B;B0BB0BB0B-	B
B-	%B-	'	B0)r   r   r!   r   matchesr   rG   rH   r   rA   r   ZrouterZinternal_busZclientZdefault_userZdefault_systemZOSErrorZattach_eventerrnoZEBUSYasyncioZLockrM   create_taskrN   )r   Zoptionsr   rL   excZerrrP   s   f&     r   do_openZDBusChannel.do_open   s   #%
KK'	kk% ++i(	l"?sf}&'7Astt=w		R777tyyPT?TU
"6		B;;33::)#LL!9499E"//1DHH_LL!8$))D"113DH&'7=QTPUUVAWXX	HH!!$* &-\\^"99 = = Y[)JJL/  	l/;PQTPUU[\_[`9abhkk	l
  	yyEKK' (	sL   A&H 8AH AH AH H H= H:!H55H:=I2 I--I2c                s(  a a \        R	/ VB pR VR&   RV9  d   S P                  e   S P                  VR&   VP                  R4      R8X  d   VR VV 3R lpS P                  e#   RV9   d   VR,          S P                  8X  d   TpMSpRP                  R VP	                  4        4       4      pS P                  4       '       g<     S P                  P                  We4      p S P                  P                  T4       R# R#   \         d     KK  i ; i)
signaltyperC   Npath_namespaceZ/c                 sz   < SP                   e,   SP                   V P                  4       8X  d   S! V 4       R # R # R # r   )r;   Z
get_senderr@   rB   r      &r   filter_ownerZ4DBusChannel.add_signal_handler.<locals>.filter_owner  s2    zz%$**8J8J8L*L  +M%r   Z,c              3   s6   "   T F  w  rV R V R2x  K  	  R# 5i)z='Z'Nr   )Z.0Zkeyr4   s   &  r   Z	<genexpr>Z1DBusChannel.add_signal_handler.<locals>.<genexpr>  s     K:3se2eWA.s   r   )dictr   r!   r(   r3   Z
is_closingr   	add_matchZInterruptedErrorrQ   Zappend)r   rB   kwargsZrr\   ZfuncZr_stringZmatchs   ff,     r   rF   ZDBusChannel.add_signal_handler  s    N6N&	1!6))AhK 55!"c)"#	! 99 X]q{dii7ODD88KKK   HH..x>E LL& ! ( s   D DDc                s>   a a VV 3R  lpS P                   ! V3/ VB  R# )c                 s6   < SP                  S! V 4      4       R # r   )rT   rZ   r[   r   sync_handlerZ:DBusChannel.add_async_signal_handler.<locals>.sync_handler   s    WW-.r   N)rF   )r   rB   r_   r`   s   ff, r   add_async_signal_handlerZ$DBusChannel.add_async_signal_handler  s    	/77r   c           
     s  "   VR ,          w  r#rEVP                  R4      pVP                  R4      pVP                  R4      pVe   VR,          pMRpVP                  R4      p	V	f   \        V4      ^ 8X  d   Rp	V	fR    \        P                  RW44       V P                  P                  W4V P                  V P                  V4      G Rj  xL
 p	 V P                  P                  ! V P                  W#WI.VO5!  pV P                  P                  WR7      G Rj  xL
 pV P                  ;_uu_4       GRj  xL
  T P                  VP!                  4       .TVe   RMRVP                  R4      R7       RRR4      GRj  xL
  R#  L  \         d9   p
T P                  T
P                  R	T
P                   2..TR
7        Rp
?
R# Rp
?
i\         d"    T P                  RRT RT R2..TR
7        R# \         d&   pT P                  RR	T: 2..TR
7        Rp?R# Rp?ii ; i EL L L  + GRj  xL 
 '       g   i     R# ; i  \         d6   p
T P                  T
P                  T
P                  ..TR
7        Rp
?
R# Rp
?
i\         dD    \        P#                  RT4       T P                  R\$        P&                  ! 4       ..TR
7        R# i ; i5i)callidflagstimeoutNi  rX   r'   z%Doing introspection request for %s %szIntrospection: rJ   rc   z(org.freedesktop.DBus.Error.UnknownMethodzIntrospection data for method Z z not availablezpython.error)re   Z<T)replyrc   rd   rX   zdo_call(%s): generic exceptionl    )r!   ZlenrG   rH   r   r*   r   r   r   r<   r@   r    Z	ExceptionZmessage_new_method_callZ
call_asyncrM   r?   Z	exception	tracebackZ
format_exc)r   r@   r6   ifacer)   Zargscookierd   re   Z	signaturerJ   rU   Zmethod_callrg   s   &&            r   do_callZDBusChannel.do_call$  s    $+FO!VT"G$++i(tOG "G KK'	 TaI DeT"&**":":5$((TXT]T]_c"dd		X((::499dSYlgklK((--k-KKE 1111 >>+,!&!2#,,T2  4 211) e ejj_U]]O3T2U%V[ab B9%&XY[ 	  
  n7P6Q%RW]^ L 2111  	KNN%**u}}o!>6NJJ 	X=wGNN.93G3G3I2J!KPVNW	Xs  A;K>AF 	F
F A	I	 H%I	 5H(6I	 9:H,3I	 >H*?I	 KF H"-G?KH"H"0K3H"<H"=HKH""K%I	 (I	 *I	 ,I	2H53
I	>I	 I	 KI	 	K*J>KKA KKKKc                s   a "   VR ,          p\         P                  RV4       V 3R lpS P                  ! V3/ VB  R# 5i)	add-matchzadding match %sc                 s  <"   \         P                  R 4       SP                  ;_uu_4       GRj  xL
  SP                  V P	                  4       V P                  4       V P                  4       \        V P                  4       4      .R7       RRR4      GRj  xL
  R#  Lm L  + GRj  xL 
 '       g   i     R# ; i5i)z	got matchN)rW   )	rG   rH   rM   r<   get_pathr%   
get_memberZlistr?   )r@   r   r=   r   	match_hitZ+DBusChannel.do_add_match.<locals>.match_hita  s}     LL%1111$$&))+&&())+,	'  211111sK   .C BC AB#C B!C !C #B=	)B,*
B=	5B=	7	C N)rG   rH   ra   )r   r@   r^   ro   s   f&  r   do_add_matchZDBusChannel.do_add_match]  s9     K(	&	2	 	%%i=9=s   ;>c                s  a a"   VV 3R  lpS P                  VVRR7       S P                  P                  S P                  VRR4      G Rj  xL
 w  pVP	                  4        F  w  rxVP	                  4        Fr  w  rSe
   V	S8X  g   K  S P
                  P                  V	S P                  S P                  V4      G Rj  xL
 pV'       d   VP                  W/4       \        WGW4       Kt  	  K  	  R#  L L65i)c           	      s  <"   V P                  4       pVR 8X  Ed   V P                  4       w  r#\        P                  RW#4       / p/ pSP                  ;_uu_4       GRj  xL
  VP                  4        Fr  w  rgS
e
   VS
8X  g   K  SP                  P                  VSP                  SP                  V4      G Rj  xL
 pV'       d   VP                  Wh/4       \        WRWg4       Kt  	  SP                  VR7       SP                  VR7       RRR4      GRj  xL
  R# VR8X  d   V P                  4       w  r)\        P                  RW)4       SP                  ;_uu_4       GRj  xL
  V\        P                  V	4      /pSP                  VR7       RRR4      GRj  xL
  R# R#  ELJ L L  + GRj  xL 
 '       g   i     R# ; i Le L.  + GRj  xL 
 '       g   i     R# ; i5i)ZInterfacesAddedzinterfaces added %s %sNmetar5   ZInterfacesRemovedzinterfaces removed %s %s)rn   r?   rG   rH   rM   r3   r   r&   r   r   r   r8   r<   r]   Zfromkeys)r@   rD   r6   Zinterface_propsrr   r5   r   r7   mmr   r#   r   s   &         r   rB   Z6DBusChannel.setup_objectmanager_watch.<locals>.handlerr  sx    '')F***1*:*:*<'5tM5555'6'<'<'>)1T^5K'+zz'F'FtTXXW[W`W`bf'g!gB! $TJ 7)&D (? NNN-NN&N1 655 ..%,%5%5%7"7J5555"DMM*$=>FNN&N1 655 / 6 "h 6555 6555s   AG/ F*!G/$F15F1<F-
=F1	AF1G/F/AG/(G)G/,*GG/!G"	G/-F1/G/1G	7F:8
G	G	
G/G/G,	G
G,	$G,	&	G/z"org.freedesktop.DBus.ObjectManager)r6   r   ZGetManagedObjectsN)	ra   r   r   r   r3   r   r&   r   r8   )r   r6   r#   rr   r5   rB   ZobjectsZpZifacesri   r7   rt   s   f&f&&       r   setup_objectmanager_watchZ%DBusChannel.setup_objectmanager_watchm  s     
	2. 	%%g+/0T 	& 	V 33DIIt4X4GI I !IA &!)Un-D#zz>>udhhPTPYPY[\]]BUK0!&U: !/ )I ^s0   AC7C38C7	5C7>C5?C7)C75C7c           	     s4  a "   V 3R  lpS P                   P                  S P                  S P                  V4      G Rj  xL
 pVe   VP	                  V4      pW(/pVP                  V4       V'       d   S P                  VRVR7       MS P                  VRVR7       V F]  p	V	P                  R4      '       d   K   S P                  P                  S P                  VRRRV	4      G Rj  xL
 w  p
\        WQW4       K_  	  R#  L L  \         d     Ku  i ; i5i)c                 s^  <"   S	P                   ;_uu_4       GR j  xL
  V P                  4       pV P                  4       w  r#p\        P	                  RWW44       V F<  p S	P
                  P                  S	P                  VRRRW%4      G R j  xL
 w  pYcT&   K>  	  / p\        WW#4       S	P                  VR7       R R R 4      GR j  xL
  R #  L LB  \         d.   p\        P	                  RY%S	P                  Y4        R p?K  R p?ii ; i LE  + GR j  xL 
 '       g   i     R # ; i5i)NzNOTIFY: %s %s %s %sorg.freedesktop.DBus.PropertiesZGetZssz+failed to fetch property %s.%s on %s %s: %srs   )rM   rm   r?   rG   rH   r   r   r   r   r8   r<   )
r@   r6   r   r7   ZinvalidsZinvrg   rU   r5   r   s
   &        r   rB   Z-DBusChannel.setup_path_watch.<locals>.handler  s     1111'')(/(8(8(:%X2DP#C!'+xx'A'A$))TBcejBF(S "S "'#J $ fD8f-! 211"S $ !%R%)		4F ! 2111s   D-CD-A D!-CC
C(D=D-D	D-CD	"D	 DD	DD-D*	D
D*	"D*	$	D-Nrv   )r   rY   )r   r6   zorg.freedesktop.DBus.ZGetAllrE   )r   r   r   r   r!   r   ra   Z
startswithr   r8   r   )r   r6   r#   Zrecursive_propsrr   r5   rB   Z	this_metar   r   r7   s   f&&&&&     r   setup_path_watchZDBusChannel.setup_path_watch  s    	.& **44TXXtyy$OO	%!n5I'3II))'4U9= * ? ))'4U/3 * 5 D677#xx99$))T:[:BC O O fD8  P$O  sL   ;DD4D4AD<-D)D*D<DDDDDDc           	     s  "   VR ,          pVP                  R4      pVP                  R4      pVP                  R4      pVP                  R4      pT;'       g    TpW48H  pVe   VfB   \        P                  RV4       V P                  RR..VR	7       V P                  . VR
7       R#  V P                  ;_uu_4       GRj  xL
  / p/ p	V P                  W5WxV	4      G Rj  xL
  V'       d   V P                  W5W4      G Rj  xL
  V P                  VR7       V P                  V	R7       V P                  . VR,          R
7       RRR4      GRj  xL
  R#  L Lx LX L  + GRj  xL 
 '       g   i     R# ; i  \         dV   p
\        P                  RYP                  4       T P                  T
P                  T
P                  ..TR	7        Rp
?
R# Rp
?
ii ; i5i)watchr6   rY   r   rc   Nz#ignored incomplete watch request %szx.y.zzNot Implementedrf   )rg   rc   rq   rs   z#do_watch(%s) caught D-Bus error: %s)
r!   rG   rH   r<   rM   rw   ru   r   r@   r   )r   r@   rx   r6   rY   r#   rj   Z	recursiverr   r5   rJ   s   &&         r   do_watchZDBusChannel.do_watch  s     yy #34;/T"%%~*	<6>LL>HNN',=+>!?FNKNNN/	K1111++D)SYZZZ88t\\\D)f-RGDM: 211 [\ 2111  	KLL>WNN%**u}}o!>6NJJ	Ks   B'G *E= EE= E !E"E .E EAE E= EE= G E= E E E=  E:	&E)'
E:	2E:	4E= 8G :E= =GA
GG GG c                sR   "   V P                   P                  VR ,          4       R# 5i)rr   N)r   r   )r   r@   r   r   do_metaZDBusChannel.do_meta  s     

'&/*s   %'c                s   \         P                  ! V4      p\        P                  R V P                  V4       RV9   d#   V P                  V P                  V4      4       R# RV9   d#   V P                  V P                  V4      4       R# RV9   d#   V P                  V P                  V4      4       R# RV9   d#   V P                  V P                  V4      4       R# \        P                  RV4       R# )zreceive dbus request %s %srb   rl   rx   rr   zignored dbus request %sN)
jsonZloadsrG   rH   r   rT   rk   rp   ry   rz   )r   Zdatar@   s   && r   do_dataZDBusChannel.do_data  s    **T"1499gFWT\\'23G#T..w78T]]734wT\\'23LL2G<r   c                sz    V P                    F  pVP                  4        K  	  . V n         V P                  4        R # r   )rQ   ZcancelrO   )r   Zslots   & r   do_closeZDBusChannel.do_close  s)    LLDKKM !

r   )r   r   rQ   r   r;   rM   )r+   r,   r-   r.   r    ZJSONEncoderZjson_encoderZpayloadrQ   r   r   r;   rK   rV   rF   ra   rk   rp   ru   rw   ry   rz   r|   r}   r/   r0   r1   r2   r   r9   r9      sv     !--Q7LGGD
CE&$P1f'<8
7Xr> (;T.`K<+  r   r9   )rS   rR   r{   Zloggingrh   Zxml.etree.ElementTreeZetreeZElementTreer   Zcockpit._vendorr    Zcockpit._vendor.systemd_ctypesr   r   r   Zchannelr   r   Z	getLoggerr+   rG   r   r8   r9   r   r   r   <module>r~      sX   2      " " * G G +			8	$D/; /;dY_' _r   