%PDF- %PDF-
Mini Shell

Mini Shell

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

�

QKf�?���ddlZejdd�ddlmZddlmZddlmZddlZejdde�ddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZd	d
lmZd	dlmZddlmZdd
lmZGd�de�ZGd�deej2�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�Z Gd�de�Z!Gd �d!e�Z"Gd"�d#e�Z#Gd$�d%e#�Z$Gd&�d'e�Z%y)(�N�Gtkz3.0)r)�Gdk)�Gio�ignorezAccessed deprecated property�)�LivePatchSocket)�get_dist)�gettext)�ngettextc�,�eZdZd�Zd�Zd�Zd�Zdd�Zy)�Dialogc��||_y�N)�window_main��selfrs  �7/usr/lib/python3/dist-packages/UpdateManager/Dialogs.py�__init__zDialog.__init__2s
��&���c��yr��rs r�startzDialog.start5���rc�"�|j�Sr)�stoprs r�closezDialog.close8s���y�y�{�rc��yrrrs rrzDialog.stop;rrNc��yrr�r�parents  r�runz
Dialog.run>rrr)�__name__�
__module__�__qualname__rrrrr"rrrr
r
1s��'�
��
�
rr
c�"�eZdZd�Zdd�Zdd�Zy)�
BuilderDialogc���tj||�tjj|�|j	||�}|j|j
|��|j�yr)r
rr�	Alignment�_load_ui�add�
get_object�show)rr�ui_path�root_widget�builders     rrzBuilderDialog.__init__CsR������k�*��
�
���t�$��-�-���5������#�#�K�0�1��	�	�rc��tj�}|j|�|j||g�|j	|�|j�D]j}t
t|�tj�r-tjj|�}t|||��Stjd|z��l|S)Nz"WARNING: can not get name for '%s')
r�Builder�set_translation_domain�add_objects_from_file�connect_signals�get_objects�
issubclass�type�	Buildable�get_name�setattr�logging�debug)r�pathr/�domainr0�o�names       rr*zBuilderDialog._load_uiKs����+�+�-���&�&�v�.��%�%�d�[�M�:�����%��$�$�&�	H�A��$�q�'�3�=�=�1��}�}�-�-�a�0����d�A�&��
�
�B�Q�F�G�	H��rNc��|r6|jj|�|jjd�|jj�y�NT)�
window_dialog�set_transient_for�	set_modalr"r s  rr"zBuilderDialog.runZs?������0�0��8����(�(��.������ r)zupdate-managerr)r#r$r%rr*r"rrrr'r'Bs���
�!rr'c�R�eZdZd
d�Zd�Zdd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
y)�InternalDialogNc�8�tjj|jd�}tj|||d�tjjd�|_	d|_
|j|�|jd|j�y)Nzgtkbuilder/Dialog.ui�pane_dialogzcom.ubuntu.update-manager�realize)�osr>�join�datadirr'rr�Settings�new�settings�focus_button�set_content_widget�connect�_on_realize)rr�content_widgetr.s    rrzInternalDialog.__init__csr���'�'�,�,�{�2�2�4J�K�����t�[�'�=�I����(�(�)D�E��
� �������/����Y�� 0� 0�1rc���|jrk|jjd�|jjd�|jj�|jj	�yyrC)rR�set_can_default�
set_can_focus�grab_default�
grab_focus)r�	user_datas  rrUzInternalDialog._on_realizems\��������-�-�d�3����+�+�D�1����*�*�,����(�(�*�	rc���tjj|�}|jd�fd��|j	�|j
j
|�|j
j||�|S)N�clickedc�����Srr)�x�callbacks �r�<lambda>z+InternalDialog.add_button.<locals>.<lambda>ws	���H�J�r)r�Button�new_from_stockrTr-�	buttonboxr+�set_child_secondary)r�labelra�	secondary�buttons  `  r�
add_buttonzInternalDialog.add_buttontsZ������*�*�5�1�����y�"6�7����
������6�"����*�*�6�9�=��
rc��tjjd�r'|jt	d�|j
d��Sy)Nz /usr/bin/software-properties-gtkuSettings…T)rh)rLr>�existsrj�_�on_settings_button_clickedrs r�add_settings_buttonz"InternalDialog.add_settings_button}s@��
�7�7�>�>�<�=��?�?��-� �$�"A�"A�T�#��
�rc�8�|jj�yr)r�
show_settingsrs rrnz)InternalDialog.on_settings_button_clicked�s�����&�&�(rc��|r|jjd|z�|jjt|��y)Nz+<span size='larger' weight='bold'>%s</span>)�label_header�
set_markup�set_visible�bool�rrgs  r�
set_headerzInternalDialog.set_header�s;������(�(�=��E�
�	
���%�%�d�5�k�2rc��|r|jj|�|jjt|��yr)�
label_descrtrurvrws  r�set_desczInternalDialog.set_desc�s-����O�O�&�&�u�-����#�#�D��K�0rc��|r|jj|�|jjt|��yr)�main_containerr+rurv)rrVs  rrSz!InternalDialog.set_content_widget�s2������#�#�N�3����'�'��^�(<�=rc�`�tj�}t�}|j|�Sr)�distro_info�UbuntuDistroInfor	�is_lts)r�di�codenames   r�_is_livepatch_supportedz&InternalDialog._is_livepatch_supported�s&��
�
)�
)�
+���:���y�y��"�"rc�:�|jd�|sy|j�rh|jr\|jj	d�dk\r>|jtd��|jj
td��yd}|dk(rd}n�|dk(rn�|d	k(r�|d
k(s|dk(rd}n�|dk(rP|D�cgc]}|js�|��}}td
dt|��t|�z}|j|�nf|dk(s|dk(rP|D�cgc]}|js�|��}}tddt|��t|�z}|j|�n|dk(rn|dk(r	|r&|jj|j�yycc}wcc}w)Nzlaunch-count�ze<b>Tip:</b> You can use Livepatch with Ubuntu Pro to keep your computer more secure between restarts.uSettings & Pro…Fzneeds-checkTzcheck-failed�checked�	unapplied�applying�appliedz3%d Livepatch update applied since the last restart.z4%d Livepatch updates applied since the last restart.zapplied-with-bugzapply-failedz;%d Livepatch update failed to apply since the last restart.z<%d Livepatch updates failed to apply since the last restart.znothing-to-apply�unknown)
r{r��settings_buttonrQ�get_intrm�	set_label�patchedr�len�	lp_socket�
get_status�on_livepatch_status_ready)r�active�cs�ps�fixes�needs_reschedule�fix�ds        rr�z(InternalDialog.on_livepatch_status_ready�s����
�
�d����,�,�.��(�(��M�M�)�)�.�9�Q�>��
�
��3����$�$�.�.�q�1D�/E�F�� ��
���#��
�>�
!��
�9�_��[� �B�*�$4�#'� ��y��(-�=������=��=��I�J���J����J�	��
�
�
�a� ��)�)�R�>�-A�(-�=������=��=��$�$���J����J�
���
�
�a� ��)�)���y�����N�N�%�%�d�&D�&D�E���->��>s�8F�
F�F�$Fc�l�t�|_|jj|j�yr)rr�r�r�rs r�check_livepatch_statusz%InternalDialog.check_livepatch_status�s$��(�*������!�!�$�"@�"@�Arr�F)r#r$r%rrUrjrornrxr{rSr�r�r�rrrrHrHbs<��2�+���)�3�1�
>�
#�
4F�lBrrHc��eZdZd�Zd�Zy)�StoppedUpdatesDialogc�@�tj||�|jtd��|j	�|jtd�|j�|jtj|jj�|_y)Nz"You stopped the check for updates.z_Check Again)rHrrxrmrorj�checkr�STOCK_OKrrrRrs  rrzStoppedUpdatesDialog.__init__�sm������k�2�����>�?�@�� � �"�����.�)�4�:�:�6� �O�O��L�L�$�*�*�0�0�
��rc�8�|jj�yr�r�start_updaters rr�zStoppedUpdatesDialog.check�������%�%�'rN)r#r$r%rr�rrrr�r��s��
�(rr�c��eZdZdd�Zy)�NoUpdatesDialogc�Z�tj||�|r|jtd��n|jtd��|j	�|_|j
tj|jj�|_|j�y)Nz"No software updates are available.�,The software on this computer is up to date.)
rHrrxrmror�rjrr�rrrRr�)rr�error_occurreds   rrzNoUpdatesDialog.__init__�s~������k�2���O�O�A�B�C�D��O�O�A�L�M�N�#�7�7�9��� �O�O��L�L�$�*�*�0�0�
���	
�#�#�%rNr��r#r$r%rrrrr�r��s��
&rr�c��eZdZd�Zd�Zy)�DistUpgradeDialogc���tj||�||_|jt	d��|jt	d�|j|jj|jfz�|j�|jt	d�|j�|jtj|jj �|_y)Nr�z.However, %s %s is now available (you have %s).u
Upgrade…)rHr�meta_releaserxrmr{�flavor_name�
upgradable_to�version�current_dist_versionrorj�upgraderr�rrrR�rrr�s   rrzDistUpgradeDialog.__init__�s�������k�2�(�������H�I�J��
�
�
�>�?��(�(��*�*�2�2��1�1��
�	
�	
� � �"�����,�����6� �O�O��L�L�$�*�*�0�0�
��rc��d}|jr`|jjrJ|jjjr|dz}|jjjr|dz}t	j
dddd|z�y)N�z -dz -p�/bin/sh�-cz</usr/bin/do-release-upgrade --frontend=DistUpgradeViewGtk3%s)r�options�
devel_release�use_proposedrL�execl)r�
extra_argss  rr�zDistUpgradeDialog.upgrade	s~���
����� 0� 0� 8� 8����'�'�5�5�'�%�/�
����'�'�4�4�'�%�/�
�
������
/�1;�
<�		
rN)r#r$r%rr�rrrr�r��s��
�&
rr�c��eZdZd�Zd�Zy)�HWEUpgradeDialogc��tj||�|jtd��tj
j
�tjjkr=|jttjjj��n<|jttjjj��|j�|jtd�|j �|jt"j$|j&j(�|_y)Nz3New important security and hardware support update.u_Install…)rHrrxrm�datetime�date�today�HweSupportStatus�consts�HWE_EOL_DATEr{�Messages�HWE_SUPPORT_ENDS�HWE_SUPPORT_HAS_ENDEDrorj�installrr�rrrRrs  rrzHWEUpgradeDialog.__init__s�������k�2����
�C�D�	
��=�=��� �#3�#:�#:�#G�#G�G��M�M�!�,�3�3�<�<�M�M�N�O��M�M��"�)�)�2�2�H�H�I�
�	
� � �"�����-�(�$�,�,�7� �O�O��L�L�$�*�*�0�0�
��rc�<�|jjd��y)NT)�hwe_upgrade)r�
start_installrs rr�zHWEUpgradeDialog.install,s�����&�&�4�&�8rN)r#r$r%rr�rrrr�r�s��
�"9rr�c��eZdZd�Zd�Zy)�UnsupportedDialogc��tj|||�|jtd�|j|j
fz�|j
td�|j|jjfz�y)Nz2Software updates are no longer provided for %s %s.z,To stay secure, you should upgrade to %s %s.)	r�rrxrmr�r�r{r�r�r�s   rrzUnsupportedDialog.__init__1sz���"�"�4��l�C����
�B�C��'�'��)J�)J�K�
L�	
�
	
�
�
�
�<�=��'�'��)C�)C�)K�)K�L�
M�	
rc�f�|j|j_tj	||�yr)rDr�no_longer_supported_nagr�r"r s  rr"zUnsupportedDialog.run>s&��37�3E�3E����0����d�F�+rN)r#r$r%rr"rrrr�r�0s��
�,rr�c��eZdZd�Zy)�NoUpgradeForYouDialogc�(�tj||�|jtd��|j	td�||j
fz�|j
tj|jj�|_y)Nz1Sorry, there are no more upgrades for this systemz�
There will not be any further Ubuntu releases for this system's '%s' architecture.

Updates for Ubuntu %s will continue until 2023-04-26.

If you reinstall Ubuntu from ubuntu.com/download, future upgrades will be available.)rHrrxrmr{r�rjrr�rrrR)rrr��archs    rrzNoUpgradeForYouDialog.__init__Esz������k�2�����M�N�O��
�
�
�5�
��\�6�6�7�
8�		
�!�O�O��L�L�$�*�*�0�0�
��rNr�rrrr�r�Ds��
rr�c��eZdZd�Zd�Zd�Zy)�PartialUpgradeDialogc�^�tj||�|jtd��|j	td��|j�|j
td�|j�|j
td�tj�|_
y)Nz Not all updates can be installeda2Run a partial upgrade, to install as many updates as possible.

    This can be caused by:
     * A previous upgrade which didn't complete
     * Problems with some of the installed software
     * Unofficial software packages not provided by Ubuntu
     * Normal changes of a pre-release version of Ubuntuz_Partial Upgrade�	_Continue)rHrrxrmr{rorjr�r�	main_quitrRrs  rrzPartialUpgradeDialog.__init__Ys~������k�2�����<�=�>��
�
�
�<�	
�	
�	
� � �"�����,�-�t�|�|�<� �O�O�A�k�N�C�M�M�J��rc�4�tjdddd�y)Nr�r�zR/usr/lib/ubuntu-release-upgrader/do-partial-upgrade --frontend=DistUpgradeViewGtk3)rLr�rs rr�zPartialUpgradeDialog.upgradels��
������
-�		
rc�V�tj|�tj�yr)r
rr�mainrs rrzPartialUpgradeDialog.startus�����T�����
rN)r#r$r%rr�rrrrr�r�Xs��K�&
�rr�c��eZdZdd�Zd�Zy)�ErrorDialogNc�@�tj||�|j|�|r,|j|�|jjd�|j
�|jtj|jj�|_yrC)
rHrrxr{rz�set_selectablerorjrr�rrrR�rr�header�descs    rrzErrorDialog.__init__|sq������k�2��������M�M�$���O�O�*�*�4�0�� � �"� �O�O��L�L�$�*�*�0�0�
��rc�f�tj|�|jjdd�y)Nr)r
rrz�
select_regionrs rrzErrorDialog.start�s$�����T��	
���%�%�a��+rr)r#r$r%rrrrrr�r�{s��	
�,rr�c� �eZdZdd�Zd�Zd�Zy)�UpdateErrorDialogNc��tj||||�|jj�|j	td�|j�|j	tj|j�|_y)Nz
_Try Again)
r�rrR�destroyrjrm�updaterr��	availabler�s    rrzUpdateErrorDialog.__init__�sY�����T�;���=����!�!�#�����,�����5� �O�O�C�L�L�$�.�.�I��rc�8�|jj�yrr�rs rr�zUpdateErrorDialog.update�r�rc�<�|jjd��y)NT)r�)r�start_availablers rr�zUpdateErrorDialog.available�s�����(�(��(�=rr)r#r$r%rr�r�rrrr�r��s��J�(�>rr�c�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�NeedRestartDialogc�6�tj||�|jtd��|j	�|jtd�|jj�|_|jtd�|j�y)Nz;The computer needs to restart to finish installing updates.zRestart _Laterz_Restart Now)
rHrrxrmrorjrrrR�restartrs  rrzNeedRestartDialog.__init__�sv������k�2����
�K�L�	
�	
� � �"� �O�O�
����!1�!1�!7�!7�
���	
����.�)�4�<�<�8rc��tj|�|jj�|jj	�jtjjtjjz�yr)
r
rrrK�
get_window�
set_functionsr�
WMFunction�MOVE�MINIMIZErs rrzNeedRestartDialog.start�sY�����T����� � �"����#�#�%�3�3��N�N���#�.�.�"9�"9�9�	
rc�X�|j�|jj�yr)�#_request_reboot_via_session_managerrr)r�args�kwargss   rr�zNeedRestartDialog.restart�s ���0�0�2������ rc��	tj�}|jdd�}tj|d�}|j	�y#tj
$r|j
�Yyt$rYywxYw)Nzorg.gnome.SessionManagerz/org/gnome/SessionManager)�dbus�
SessionBusr,�	Interface�
RequestReboot�
DBusException�_request_reboot_via_consolekit�	Exception�r�bus�	proxy_obj�ifaces    rr�z5NeedRestartDialog._request_reboot_via_session_manager�sr��
	��/�/�#�C����*�,G��I��N�N�9�.H�I�E����!���!�!�	2��/�/�1��	��	���AA�#A?�4A?�>A?c��	tj�}|jdd�}tj|d�}|j	�y#tj
$r|j
�Yyt$rYywxYw)Nzorg.freedesktop.ConsoleKitz#/org/freedesktop/ConsoleKit/Managerz"org.freedesktop.ConsoleKit.Manager)r�	SystemBusr,r�Restartr�_request_reboot_via_logindrr	s    rrz0NeedRestartDialog._request_reboot_via_consolekit�st��
	��.�.�"�C����,�5��I��N�N��?��E�
�M�M�O���!�!�	.��+�+�-��	��	�r
c���	tj�}|jdd�}tj|d�}|j	d�y#tj
$rYywxYw)Nzorg.freedesktop.login1z/org/freedesktop/login1zorg.freedesktop.login1.ManagerT)rrr,r�Rebootrr	s    rrz,NeedRestartDialog._request_reboot_via_logind�s^��	��.�.�"�C����(�*C��I��N�N�9�.N�O�E��L�L�����!�!�	��	�s�A
A�A&�%A&N)	r#r$r%rrr�r�rrrrrr�r��s ��	9�
�!��� 	rr�)&�gi�require_version�
gi.repositoryrrr�warnings�filterwarnings�DeprecationWarningr<r�rrrL�HweSupportStatus.constsr��Core.LivePatchSocketr�
Core.utilsr	r
rmr�objectr
r)r'rHr�r�r�r�r�r�r�r�r�r�rrr�<module>rs��.
�����5�%� ����������,�.@������	��1� � ��
�V�
�"!�F�C�M�M�!�@tB�]�tB�n(�>�(�&�n�&�"
��"
�J9�~�9�,,�)�,�(
�N�
�( �>� �F,�.�,�&>��>�>��>r

Zerion Mini Shell 1.0