+
    i`  c                   s6   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
Ht ^ RIHtHtHtHt ^RIHt ]P&                  ! ]4      t ! R R]P,                  4      t ! R R	]P,                  4      t ! R
 R]P,                  4      tR]3R]3R]3.tR# )i    N)Path)DictOptional)Variantbusinotify	pathwatch)configc                   s   a  ] tR t^t o RtV 3R lR lt]P                  P                  R.R7      R 4       t	]P                  P                  . R7      V 3R lR l4       t
V 3R	 ltR
tV tR# )cockpit_LoginMessagesNc                   < V ^8  d   QhRR/#    returnN format__classdict__   "?/usr/lib/python3.14/site-packages/cockpit/internal_endpoints.py__annotate__"cockpit_LoginMessages.__annotate__   s     P P$ P    c                s   \         P                  P                  R R4      pVf   \        P	                  R4       R# \        P	                  RV4        \        \        V4      R4      ;_uu_ 4       pVP                  ^ 4       VP                  4       V n	        RRR4       \        P	                  RV P                  4       R#   + '       g   i     L2; i  \        \        \        3 d"   p\        P	                  RT4        Rp?R# Rp?ii ; i)ZCOCKPIT_LOGIN_MESSAGES_MEMFDNzBCOCKPIT_LOGIN_MESSAGES_MEMFD wasn't set.  No login messages today.z(Trying to read login messages from fd %sZrz$Successfully read login messages: %sz!Reading login messages failed: %s)osZenvironZpoploggerZdebugopenintZseekZreadmessagesZ
ValueErrorOSErrorZUnicodeDecodeError)selfZfdstrZlogin_messagesexc   &   r   __init__Zcockpit_LoginMessages.__init__   s    

=tD=LL]^?G	Pc%j#&&.##A& . 3 3 5 ' LL?O '& G%78 	C
 LL<cBB	Cs0   C 0'CC C	C D*DDs)Z	out_typesc                s.    V P                   ;'       g    R # )z{}r   r      &r   getZcockpit_LoginMessages.get.   s    }}$$$r   c                r	   r
   r   r   r   r   r   r   3   s       r   c                s    R V n         R # Nr!   r"   r#   r   dismissZcockpit_LoginMessages.dismiss2   s	    r   c                s6   < V ^8  d   Qh/ S[ S[,          ;R&   # )r   r   )r   strr   r   r   r   r      s     sm" r   r!   )__name__
__module____qualname____firstlineno__r   r   r   	InterfaceMethodr$   r&   __annotate_func____static_attributes____classdictcell__r      @r   r   r      sk     "HP P( 	]]SE*% +% 	]]B' (9  r   r   c                   s"  a  ] tR t^7t o ]P
                  P                  R4      t]P                  V 3R lR l4       t	]P
                  P                  . ROR7      V 3R lR l4       tV 3R lR ltV 3R	 lR
 ltV 3R lR ltR tV 3R ltRtV tR# )cockpit_Machinesz	a{sa{sv}}c                sL   < V ^8  d   QhRS[ S[S[ S[S[3,          3,          /# )r   r   )r   r'   r   r   r   r   r   cockpit_Machines.__annotate__@   s'      d3S'\(:#:; r   c                s`   / p\         P                   ! V P                   R 24       F  p \        V4      ;_uu_ 4       p \        P                  ! V4      pTP                  4        F5  w  rVTP                  4        UUu/ uF  w  rxT\        T4      bK  	  uppY&   K7  	  RRR4       K  	  V#   \        P
                   d#    \        P                  RT4        RRR4       K  i ; iu uppi   + '       g   i     K  ; i  \         d#   p	\        P                  RY)4        Rp	?	EK  Rp	?	ii ; i)z/*.jsonz#Invalid JSON in file %s.  Ignoring.Nz-Unreadable machines.d file %s: %s.  Ignoring.)globpathr   jsonloadJSONDecodeErrorr   Zwarningitemsr   r   Zerror)
r   Zresultsfilenamefpcontentshostnameattrskeyvaluer   s
   &         r   get_machinesZcockpit_Machines.get_machines?   s    13		TYYKw"78H](^^r!#'99R=
 ,4>>+;SXS^S^S`,aS`ZSS'%.-@S`,a) ,< $^ 9   // !'LhW  $^!
 -b $^^  ]Lh\\]si   D C,B,(C,=C&
C,D ,+C#	C,D "C#	#	C,,C=7D =D  D-D((D-)Zin_typesc                sF   < V ^8  d   QhRS[ RS[ RS[S[ S[3,          RR/# )r   r;   r>   r?   r   N)r'   r   r   r   r   r   r   r4   T   s3     . .s .c .$sG|:L .QU .r   c           	     s    V P                   P                  V4      P                  4       ;_uu_ 4       p\        P                  ! V4      pR R R 4       XP                  T/ 4      P                  TP                  4        UUu/ uF  w  rxYxP                  bK  	  upp4       T P                   P                  RRR7       \        T P                   P                  T4      R4      ;_uu_ 4       p\        P                  ! YT^R7       R R R 4       R #   + '       g   i     L; i  \        P
                   d%   p\        P                  ! RRT RT R24      ThR p?i\         d    / p ELi ; iu uppi   + '       g   i     R # ; i)	Nzcockpit.Machines.ErrorzFile z is in invalid format: Z.T)ZparentsZexist_okZw)Zindent)r6   Zjoinpathr   r7   r8   r9   r   ZBusErrorZFileNotFoundErrorZ
setdefaultupdater:   rA   ZmkdirZdump)	r   r;   r>   r?   r<   r=   r   r@   rA   s	   &&&&     r   rC   Zcockpit_Machines.updateS   s'   	##H-224499R= 5 	Hb)00UZU`U`Ub1cUbzs#{{2BUb1cd		t4$))$$X.44IIh1- 54 54## 	s,,75
Jabeaffg9hiorr  	H	 2d 544sR   1D D
D  E*
)E0D	D D E'4EE' E'&E'0F	c                r	   r
   r   r   r   r   r   r4   e   s     Z Z Zr   c                s   a  R  V 3R llpS P                   f-   \        P                  ! 4       P                  RV4      S n         R# R# )c                s    V ^8  d   QhRR/# r
   r   )r   s   "r   r   Z-cockpit_Machines.notify.<locals>.__annotate__f   s     	' 	'T 	'r   c                  s>   < S P                  R / R.4       RS n        R# )zcockpit.MachinesZMachinesN)Zproperties_changedpending_notifyr"   s   r   _notify_nowZ,cockpit_Machines.notify.<locals>._notify_nowf   s     ##$6ZLI"&Dr   Ng      ?)rD   asyncioZget_running_loopZ
call_later)r   rE   s   f r   notifyZcockpit_Machines.notifye   s>    	' 	'
 &")":":"<"G"G["YD 'r   c                sT   < V ^8  d   QhRS[ P                  RS[RS[S[,          RR/# )r   maskcookienamer   N)r   ZEventr   r   r'   r   r   r   r   r4   o   s3      W]] C xPS} Y] r   c                &    V P                  4        R # r%   rG   )r   rH   rI   rJ   s   &&&&r   do_inotify_eventZ!cockpit_Machines.do_inotify_evento       r   c                sJ   < V ^8  d   QhRS[ S[,          RS[ S[,          RR/# )r   fderrnor   N)r   r   r   r   r   r   r4   r   s*      hsm HSM d r   c                rK   r%   rL   )r   rO   rP   s   &&&r   do_identity_changedZ$cockpit_Machines.do_identity_changedr   rN   r   c                s    \         P                  ! R 4      V n        RV n        \        P
                  ! \        V P                  4      V 4      V n        RV n        R# )z
machines.d.N)r   Zlookup_configr6   rD   r   	PathWatchr'   watchr"   r#   r   r   Zcockpit_Machines.__init__u   sB    ((6	 "((TYY>
"r   c                sv   < V ^8  d   Qh/ S[ ;R&   S[P                  ;R&   S[S[P
                  ,          ;R&   # )r   r6   rS   rD   )r    r   rR   r   rF   ZHandler   r   r   r   r4   7   s6     
J   W^^,, r   )r6   rD   rS   N)r    r    za{sv})r(   r)   r*   r+   r   r,   PropertyZmachinesZgetterrB   r-   rC   rG   rM   rQ   r   r.   r/   r0   r1   r2   r   r3   r3   7   s      }}%%k2H__ & 	]]#67. 8."Z Z  #}  r   r3   c                   s  a  ] tR t^~t o ]P
                  P                  RRR7      t]P
                  P                  RRR7      t]P
                  P                  R^ R7      t	]P
                  P                  R^ R7      t
]P
                  P                  RRR7      t]P
                  P                  RRR7      t]P
                  P                  R. R7      tV 3R lR ltRtV tR	# )
cockpit_Userr     )rA   ZiZasc                r	   r
   r   r   r   r   r   Zcockpit_User.__annotate__   s      $ r   c                sT   \         P                  ! \        P                  ! 4       4      pVP                  V n        VP                  V n        VP                  V n	        VP                  V n        VP                  V n        VP                  V n        \         P"                  ! VP                  4      P$                  .p\         P&                  ! 4        FN  pVP                  VP(                  9   g   K   VP$                  V9  g   K3  VP+                  VP$                  4       KP  	  W n        R # r%   )pwdZgetpwuidr   ZgetuidZpw_namerJ   Zpw_gecosfullZpw_uididZpw_gidgidZpw_dirhomeZpw_shellshellgrpZgetgrgidZgr_nameZgetgrallZgr_memZappendgroups)r   Zuserr^   Zgrr   r   r   Zcockpit_User.__init__   s    ||BIIK(LL	MM	++;;KK	]]
 ,,t{{+334,,.B||ryy(RZZv-Ebjj) ! r   )rX   rZ   r^   r[   rY   rJ   r\   N)r(   r)   r*   r+   r   r,   rT   rJ   rX   rY   rZ   r[   r\   r^   r   r/   r0   r1   r2   r   rU   rU   ~   s     ==!!#R!0D==!!#R!0D			1		-B
--
 
 A
 
.C==!!#R!0DMM""3b"1E]]##D#3F r   rU   z/LoginMessagesz	/machinesz/user)rF   r5   r]   r7   Zloggingr   rW   Zpathlibr    Ztypingr   r   Zcockpit._vendor.systemd_ctypesr   r   r   r   rV   r   Z	getLoggerr(   r   ZObjectr   r3   rU   ZEXPORTSr   r   r   <module>r_      s      
   	 
  ! K K 			8	$CJJ @D#szz D#N3:: 8 ,-"#lr   