%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/UpdateManager/Core/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/UpdateManager/Core/__pycache__/LivePatchSocket.cpython-312.pyc

�

QKf���ddlmZddlZddlZddlZddlZdZGd�dejj�Z
Gd�de�ZGd�d	e�Z
y)
�)�GLibNz5/var/snap/canonical-livepatch/current/livepatchd.sockc��eZdZd�Zd�Zy)�UHTTPConnectionc�f�tjjj|d�||_y)N�	localhost)�http�client�HTTPConnection�__init__�path)�selfrs  �D/usr/lib/python3/dist-packages/UpdateManager/Core/LivePatchSocket.pyrzUHTTPConnection.__init__!s#�����"�"�+�+�D�+�>���	�c��tjtjtj�}|j|j�||_y�N)�socket�AF_UNIX�SOCK_STREAM�connectr�sock)r
rs  rrzUHTTPConnection.connect%s3���}�}�V�^�^�V�-?�-?�@�����T�Y�Y����	rN)�__name__�
__module__�__qualname__rr�rrrr s���rrc�J�eZdZdd�Zd�Zed��Zed��Zed��Zy)�LivePatchSocketNc�@�|�tt�|_y||_yr)r�	HOST_NAME�conn)r
�	http_conns  rrzLivePatchSocket.__init__,s����'�	�2�D�I�!�D�Irc�`�����fd�}tj|��}|j�y)Nc��������	�jjdd��jj�}|jdk(�t	j
|j
��}tj|��tj|��tj|��tj�����fd��y#t$rd�t�}Y�swxYw)N�GETz/status?verbose=True��Fc���������Srr)�active�check_state�fixes�on_done�patch_states�����r�<lambda>z=LivePatchSocket.get_status.<locals>.do_call.<locals>.<lambda>@s������[�%�H�r)r�request�getresponse�status�yaml�	safe_load�read�	Exception�dictr�get_check_state�get_patch_state�	get_fixesr�idle_add)�r�datar&r'r(r*r)r
s  @@@@��r�do_callz+LivePatchSocket.get_status.<locals>.do_call3s����
��	�	�!�!�%�)?�@��I�I�)�)�+�����S����~�~�a�f�f�h�/��*�9�9�$�?�K�)�9�9�$�?�K�#�-�-�d�3�E��M�M�H�
��
�
����v��
�s�A(C�C#�"C#)�target)�	threading�Thread�start)r
r)r:�threads``  r�
get_statuszLivePatchSocket.get_status2s#���	� �!�!��1�����rc�b�	|d}td�|D�d�}|ddS#t$rYywxYw)Nr.c3�,K�|]}|ds�	|���y�w��runningNr��.0�ks  r�	<genexpr>z2LivePatchSocket.get_check_state.<locals>.<genexpr>J�����=���)��1�=���
��	livepatch�
checkStatezcheck-failed��nextr2�r9r.�kernels   rr4zLivePatchSocket.get_check_stateFsD��	"��(�^�F��=�f�=�t�D�F��+�&�|�4�4���	"�!�	"���"�	.�.c�b�	|d}td�|D�d�}|ddS#t$rYywxYw)Nr.c3�,K�|]}|ds�	|���y�wrCrrEs  rrHz2LivePatchSocket.get_patch_state.<locals>.<genexpr>SrIrJrK�
patchState�unknownrMrOs   rr5zLivePatchSocket.get_patch_stateOsD��	��(�^�F��=�f�=�t�D�F��+�&�|�4�4���	��	�rQc��	|d}td�|D�d�}|dd}|jdd�jd�D�cgc]}t|�dkDrt	|���c}Scc}w#t
$r
t
�cYSwxYw)	Nr.c3�,K�|]}|ds�	|���y�wrCrrEs  rrHz,LivePatchSocket.get_fixes.<locals>.<genexpr>\rIrJrKr(z* ��
r)rN�replace�split�len�LivePatchFixr2�list)r9r.rPr(�fs     rr6zLivePatchSocket.get_fixesXs���
	��(�^�F��=�f�=�t�D�F��;�'��0�E����t�R�0�6�6�t�<����q�6�A�:��Q���
����
�	��6�M�	�s$�AA-� A(�%A-�(A-�-B�Br)	rrrrr@�staticmethodr4r5r6rrrrr+sH��"��(�"��"��������rrc��eZdZd�Zd�Zd�Zy)r]c�h�d}|j|�dk(|_|j|d�|_y)Nz (unpatched)���rX)�find�patchedrZ�name)r
�text�patched_patterns   rrzLivePatchFix.__init__hs.��(���y�y��1�R�7����L�L��"�5��	rc��t|t�r4|j|jk(xr|j|jk(StSr)�
isinstancer]rfre�NotImplemented)r
�others  r�__eq__zLivePatchFix.__eq__ms7���e�\�*��9�9��
�
�*�L�t�|�|�u�}�}�/L�L��rc�>�|j|�}|tur|S|Sr)rmrk)r
rl�results   r�__ne__zLivePatchFix.__ne__rs%�����U�#���^�#��M��z�rN)rrrrrmrprrrr]r]gs��6�
�
rr])�
gi.repositoryr�http.clientrrr<r/rr	r
r�objectrr]rrr�<module>rtsJ��.��
���C�	��d�k�k�0�0��9�f�9�x�6�r

Zerion Mini Shell 1.0