%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__/UpdateManager.cpython-312.pyc

�

QKf�L��(�ddlmZddlmZmZddlmZddlmZddlmZddlmcm	cm
cmcmcm
ZeddlZej dde�ddlZddlZddlZddlZddlZddlZddlZdd	lmZddlZddlZdd
lmZed��d
dlmZd
dl m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*d
dl+m,Z,d
dl-m-Z-d
dl.m/Z/d
dl0m1Z1d
dl2m3Z3d
dl4m5Z5d
dl6m7Z7m8Z8m9Z9d
dl:m;Z;m<Z<dZ=Gd�dej|�Z?Gd�dej�j��ZBy)�)�Gtk)�Gdk�GdkX11)�Gio)�GLib)�GObjectN�ignorezAccessed deprecated property)�gettext)�
DBusGMainLoopT)�set_as_default�)�UnitySupport)
�DistUpgradeDialog�ErrorDialog�HWEUpgradeDialog�NeedRestartDialog�NoUpdatesDialog�NoUpgradeForYouDialog�PartialUpgradeDialog�StoppedUpdatesDialog�UnsupportedDialog�UpdateErrorDialog)�MetaRelease)�UpdatesAvailable)�AlertWatcher)�MyCache)�NetworkManagerHelper)�
UpdateList)�get_arch�get_dist�SoftwarePropertiesPage)�InstallBackend�get_backendz/var/run/reboot-requiredc���eZdZdZd�Zdd�Zd�Zd�Zd�Zd�Z	dd	�Z
d
�Zd�Ze
jfd�Zd
�Zdd�Zd d�Zd�Zd�Zd�Z			d!d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)"�
UpdateManagerz|This class is the main window and work flow controller. The main
    window will show panes, and it will morph between them.c���tjj��|�_|�_t��_d�_d�_g�_	d�_
d�_d�_t��_g�_t!��_�j%t'd���j)d��j+tj,j.��j1�}|j3d�fd���_�j3d�j6��j9��jr��jj:r~�j=d��j?��jA��jCd��jjEd��j3d�jF��_$tK�jxr�jjL�jxr�jjN�jxr�jjP��_y)	NzSoftware Updaterzsystem-software-update�changedc�$���j�S�N)�resize_to_standard_width)�ctx�selfs ��=/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py�<lambda>z(UpdateManager.__init__.<locals>.<lambda>ls���4�#@�#@�#B��zdelete-eventFTzfocus-in-event))r�Window�__init__�datadir�optionsr�unity�
controller�cache�ua_security_packages�update_list�meta_release�hwe_replacement_packages�set�oem_metapackages�duplicate_packagesr�arch�	set_title�_�
set_icon_name�set_position�WindowPosition�CENTER�get_style_context�connect�
style_changed�	_on_close�_setup_dbus�no_focus_on_map�set_focus_on_map�iconify�stick�set_urgency_hint�set_urgency�on_initial_focus_in�initial_focus_idr�
devel_release�use_proposed�debug)r,r2r3r+s`   r-r1zUpdateManager.__init__Ss�����
�
���D�!�������!�^��
������
�$&��!���� ���(,��%� #����"$����J��	�	
���q�+�,�-����3�4����#�,�,�3�3�4��$�$�&�� �[�[��B�
���
	
���^�T�^�^�4������<�<�D�L�L�8�8��!�!�%�(��L�L�N��J�J�L��!�!�$�'��J�J�"�"�4�(�$(�L�L� �$�":�":�%�D�!�
(��L�L�7�T�\�\�7�7��L�L�6�T�\�\�6�6��L�L�/�T�\�\�/�/�
��r/c�x�����jd��dkDr!�dkDrtj���fd��yyy)NTrc�(���j���Sr))�resize)r,�
stored_height�stored_widths���r-r.z4UpdateManager.begin_user_resizable.<locals>.<lambda>�s���$�+�+�l�M�"J�r/)�
set_resizabler�idle_add)r,rYrXs```r-�begin_user_resizablez"UpdateManager.begin_user_resizable�s7������4� ��!��
�� 1�
�M�M�J�K�	!2�r/c�&�|jd�y�NF)rZ�r,s r-�end_user_resizablez UpdateManager.end_user_resizable�s�����5�!r/c��|j�ryd}|j�j�}|dkrd}|j�}t	j
||j�|jdtjj�}|dz|z|z}|j|d�t	j||j�y)N�!r�`z	font-size�H���)
�
get_resizable�
get_screen�get_resolutionrEr�signal_handler_blockrG�get_propertyr�
StateFlags�NORMAL�set_size_request�signal_handler_unblock)r,�num_em�dpir+�size�widths      r-r*z&UpdateManager.resize_to_standard_width�s�����������o�o��.�.�0���!�8��C��$�$�&���$�$�S�$�*<�*<�=�����S�^�^�-B�-B�C���b��4��&�(�����e�R�(��&�&�s�D�,>�,>�?r/c��|j�|jd�|jjd�|j	|j
�y)z6callback run on initial focus-in (if started unmapped)F)�unstickrNr4rO�
disconnectrQ)r,�widget�events   r-rPz!UpdateManager.on_initial_focus_in�s@���������e�$��
�
���u�%�����-�-�.�r/c��|j�X|jj�t|jtj�r|jj�||_|j
�|j�|�yt|tj�r2|j|�|j�|j�y|j�|j�yr))r5�stop�
isinstancer�Widget�destroy�_look_readyr`�add�start�show_all�hide)r,�panes  r-�_start_panezUpdateManager._start_pane�s����?�?�&��O�O� � �"��$�/�/�3�:�:�6����'�'�)�����������!��<���d�C�J�J�'��H�H�T�N��J�J�L��M�M�O��J�J�L��I�I�Kr/Nc�"�|j�Sr))�close)r,rv�datas   r-rHzUpdateManager._on_close�s���z�z�|�r/c��|j�sy|jr|jj�}|r|S|j�y�NT)�
get_sensitiver5r��exit)r,�controller_closes  r-r�zUpdateManager.close�s=���!�!�#���?�?�#���4�4�6���'�'��	�	�r/c�P�|jd�tjd�y)z$exit the application, save the stateNr)r��sysr�r_s r-r�zUpdateManager.exit�s�����������r/c�,�ddt|�g}dtjvr&|dd|j�j	�zgz
}|j�	t
j|�}|j��dtj�r)tj�tj�r�)tjd�|j���c	|j�y#t$rY�wxYw#|j�wxYw)Nz /usr/bin/software-properties-gtkz
--open-tab�WAYLAND_DISPLAYz
--toplevelz%s皙�����?)�str�os�environ�
get_window�get_xid�
_look_busy�
subprocess�Popen�pollr�events_pending�main_iteration�time�sleep�OSError�start_available)r,�page_number�cmd�ps    r-�
show_settingszUpdateManager.show_settings�s���1��S��-�/���B�J�J�.��L�$����):�)B�)B�)D�"D�E�E�C�����
	#�� � ��%�A��&�&�(�"��(�(�*��&�&�(��(�(�*��
�
�4� ��&�&�(�"�

� � �"���	��	��
� � �"�s7�C2�-AD�:%D� D�2	C>�;D�=C>�>D�Dc��|jjr|j�yt|tj
�}|j
|�yr))r3�	no_updater�r#r"�
ACTION_UPDATEr�)r,�update_backends  r-�start_updatezUpdateManager.start_update�s>���<�<�!�!�� � �"��$�T�>�+G�+G�H������(r/c���t|tj�}|r/|jD] }	|j|j��"|j|�y#t$rY�@wxYwr))r#r"�ACTION_PRE_INSTALLr:r6�mark_install�SystemErrorr�)r,�hwe_upgrade�install_backend�pkgnames    r-�
start_installzUpdateManager.start_install�sj��%�d�N�,M�,M�N����8�8�
����J�J�w�'�4�4�6�
�
	
����)��#����s�A�	A*�)A*c�@�|j�|j�|j�y|j|jj|jj
ztjjt�||�}|j|�yr))r��
refresh_cacher6�_make_available_pane�
install_count�	del_countr��path�exists�REBOOT_REQUIRED_FILEr�)r,�cancelled_update�error_occurredr�s    r-r�zUpdateManager.start_available�sx�����������:�:����(�(��J�J�$�$�t�z�z�';�';�;��G�G�N�N�/�0���	
��	
����r/c�v�tj�}t�}|j|�}|sytj
j
tj�d�}tj
j|�syt|d�5}|xjt|j�j��zc_ddd�|jD]K}t!j |j"d�s�$|j$s�1|jj'|��My#1swY�dxYw)Nzubuntu-drivers-oem.package-list�rz
oem-*-meta)�distro_info�UbuntuDistroInfor �is_ltsr�r��joinr�get_user_runtime_dirr��openr<r;�read�
splitlinesr6�fnmatch�name�	installedr~)r,�di�codename�lts�OEM_PATH�f�pkgs       r-�_check_oem_metapackagesz%UpdateManager._check_oem_metapackagess���
�
)�
)�
+���:���i�i��!�����7�7�<�<��%�%�'�)J�
���w�w�~�~�h�'���(�C�
 �	@�A��!�!�S�����)<�)<�)>�%?�?�!�	@��:�:�	/�C����s�x�x��6�3�=�=��%�%�)�)�#�.�	/�		@�	@�s�;D/�/D8c�J�tj�j|_yr))�ua�updates�
ua_updatesr_s r-�_fetch_ua_updateszUpdateManager._fetch_ua_updatess���*�*�,�.�.��r/c���g|_tj|jd��}|j	�|j�rct
j�r)t
j�t
j�r�)tjd�|j�r�c|jD]�}|jdk(s|jdk(r�"|j}|dk(s|dk(s|dk(s�>|j}|j}|j }|dk(}|jj#||||f���|j$j'|j�y)	NT)�target�daemonr�zstandard-securityzstandard-updates�pending_attach�pending_enable�upgrade_available)r7�	threading�Threadr�r�is_aliverr�r�r�r�r��provided_by�status�package�version�
download_size�appendr6�create_pro_cache)r,�tr�r�r�r�rq�downloadables        r-�_get_ua_security_statusz%UpdateManager._get_ua_security_statuss-��$&��!����D�$:�$:�4�H��	���	��j�j�l��$�$�&��"�"�$��$�$�&��J�J�t���j�j�l����	�G��#�#�':�:��&�&�*<�<���^�^�F��*�*��-�-��0�0�����!�/�/���,�,��%�)<�<���)�)�0�0��7�D�,�7��!	�&	
�
�
�#�#�D�$=�$=�>r/c�p�|j�|dk7rPd}d}|rtd�}n0|rtd�}td�}n|jrt|�St	||||�S|rt|�S|j
�}|r|S|rt|�S|jrt|�St||��S)Nru0Some software couldn’t be checked for updates.z"You stopped the check for updates.z4Updated software is available from a previous check.)r�)	�_check_hwe_support_statusr@r:rrr�_check_meta_releaserr)r,r��need_rebootr�r��header�desc�dist_upgrades        r-r�z"UpdateManager._make_available_pane8s���	
�&�&�(��A���F��D���K�L��!��?�@���J����.�.�'��-�-�#�D�&�$��D�D��(��.�.��3�3�5�L��#�#�!�+�D�1�1��.�.�'��-�-�&�t�N�K�Kr/c�z�|r|jt|||��y|jt|||��yr))r�rr)r,�update_and_retryr�r�s    r-�start_errorzUpdateManager.start_error\s4������.�t�V�T�B�C����[��v�t�<�=r/c���|jd�|j��U|j�jtjjtjj��yyr^)�
set_sensitiver��
set_cursorr�Cursor�new�
CursorType�WATCHr_s r-r�zUpdateManager._look_busybsN�����5�!��?�?��(��O�O��(�(���������8L�8L�)M�N�)r/c���|jd�|j��W|j�jd�|j�jtj
j�yyr�)r�r�r��
set_functionsr�
WMFunction�ALLr_s r-r}zUpdateManager._look_readygsV�����4� ��?�?��(��O�O��(�(��.��O�O��+�+�C�N�N�,>�,>�?�)r/c��|j�y|jjr3tj|j�tj�|jj}|r|jry|jjrt||j�Stjjd�}|jjrm|jj s|j#d�rF|j$dk(r!t'||j|j$�St)||j�Sy)Nzcom.ubuntu.update-managerzcheck-dist-upgrades�i386)r9�downloadingrr[�_meta_release_wait_idler�main�
upgradable_to�upgrade_broken�no_longer_supportedrr�Settingsr��new_distr3�check_dist_upgrades�get_booleanr>rr)r,�next�settingss   r-r�z!UpdateManager._check_meta_releasems�����$�����(�(��M�M�$�6�6�7��H�H�J�� � �.�.���t�*�*�����0�0�$�T�4�+<�+<�=�=��<�<�#�#�$?�@�����%�%��L�L�,�,��#�#�$9�:��y�y�F�"�,��$�+�+�T�Y�Y���%�T�4�+<�+<�=�=�r/c��|jjstj�y|jj	dtj�y)N�done_downloadingF)r9r�r�	main_quitrFr_s r-r�z%UpdateManager._meta_release_wait_idle�sA��� � �,�,��M�M�O��
���%�%�&8�#�-�-�H�r/c���tj�}t�}|j|�}|syd}tj
j
|�sy|dg}|j|�y)Nz/usr/bin/hwe-support-statusz--show-replacements)r�r�r r�r�r�r��_parse_hwe_support_status)r,r�r�r��HWEr�s      r-r�z'UpdateManager._check_hwe_support_status�s\��
�
)�
)�
+���:���i�i��!����+���w�w�~�~�c�"���)�*���&�&�s�+r/c��	tj|�y#tj$r�}|jdk(r�|jj�j
�}g|_|D]W}|jd�}||jvs�#|j|jr�=|jj|��YYd}~yYd}~yd}~wwxYw)N�
zutf-8)r��check_output�CalledProcessError�
returncode�output�strip�splitr:�decoder6�is_installedr�)r,r��e�packagesr�s     r-rz'UpdateManager._parse_hwe_support_status�s���	F��#�#�C�(���,�,�
	F��|�|�r�!��8�8�>�>�+�1�1�3��02��-�'�F�G�%�n�n�W�5�G��4�:�:�-� $�
�
�7� 3� @� @��5�5�<�<�W�E�
F�"��
	F�s!��C�A"C�C�(C�Cc�z�	|j�td�|_n5|jjd�|jj�d�}|�|j�|j�|jD]9}	|j|js|j|j��;t!|�|_	|j"j%|j||j&|j(��|j"j*dkDr|jt
|��yy#t$rF|jt
|��td�}td�}|jd||�Yyt$r?}td�}td�t|�z}|jd||�Yd}~yd}~wwxYw#t$rY��cwxYw#t$r@}td�}td	�t|�z}|jd
||�Yd}~��!d}~wwxYw)NzSoftware index is brokenz�It is impossible to install or remove any software. Please use the package manager "Synaptic" or run "sudo apt-get install -f" in a terminal to fix this issue at first.Fz,Could not initialize the package informationz�An unresolvable problem occurred while initializing the package information.

Please report this bug against the 'update-manager' package and include the following error message:
c��tj�r*tj�tj�r�)yyr))rr�r��r/r-�iteratez,UpdateManager.refresh_cache.<locals>.iterate�s(���$�$�&��"�"�$��$�$�&r/)�eventloop_callbackr=r7zCould not calculate the upgradez�An unresolvable problem occurred while calculating the upgrade.

Please report this bug against the 'update-manager' package and include the following error message:
Tr)r6rr��
_initDepCache�AssertionErrorr�rr@r�r�r�r�r�r<rr�rr8�updater=r7�distUpgradeWouldDelete)r,r�r�rrr�s      r-r�zUpdateManager.refresh_cache�s ��	��z�z�!�$�T�]��
��
�
����%��
�
�(�(�*�8	%�	�	��$�$�&��$�$�&��,�,�	�G�
��z�z�'�*�7�7��J�J�w�'�4�4�6��	�&�d�+���	1����#�#��
�
�#*�#'�#:�#:�%)�%>�%>�	
$�
� ���2�2�Q�6����1�$�7�8�7��}�	�
���1�$�7�8��1�2�F��'��D�
���U�F�D�1���		��E�F�F��E��
�A���D�
���U�F�D�1���		��4�
��
���	1��8�9�F��E��
�A���D�
���T�6�4�0�0��	1�sI�AE	�6G!�=G1�	AG�G�5G�G�!	G.�-G.�1	H:�:5H5�5H:c��	tj�}	|j	dd�}tj
|d�}|j
�tjd�y#t$rtd�YywxYw#tj$r4tjjd|�}t||�|_
YywxYw)z9this sets up a dbus listener if none is installed alreadyz warning: could not initiate dbusNzorg.freedesktop.UpdateManager�$/org/freedesktop/UpdateManagerObject�"org.freedesktop.UpdateManagerIFacer)�dbus�
SessionBus�	Exception�print�
get_object�	Interface�bringToFrontr�r��
DBusException�service�BusName�UpdateManagerDbusController�dbusController)r,�bus�	proxy_obj�iface�bus_names     r-rIzUpdateManager._setup_dbus�s���	��/�/�#�C�	N����/�6��I��N�N��?��E�
��� ��H�H�Q�K���	��4�5��	���!�!�	N��|�|�+�+�/���H�#>�d�H�"M�D��	N�s$�A%�A
A?�%A<�;A<�?AC�C)rrr))F)FF)FFF) �__name__�
__module__�__qualname__�__doc__r1r\r`r*rPr�rHr�r�r!r�r�r�r�r�r�r�r�r�r�r�r}r�r�r�rr�rIrr/r-r%r%Os���?�1
�fL�"�@���*���
)?�(F�(F�#�()�*�
�/�*/�?�@���"L�H>�O�
@��@�
,�F�(F9�PNr/r%c��eZdZdZ	dd�Zejjd�d��Zejjd�d��Z	d�Z
y)	r2z2this is a helper to provide the UpdateManagerIFacec���tjjj|||�||_t�|_|jjd|j�d|_	y)Nz
network-alertF)
r(r0�Objectr1�parentr�
alert_watcherrF�_on_network_alert�	connected)r,r?r7�object_paths    r-r1z$UpdateManagerDbusController.__init__sT��	
�����$�$�T�8�[�A����)�^������"�"�?�D�4J�4J�K���r/r'c�8�|jj�yr�)r?�presentr_s r-r.z(UpdateManagerDbusController.bringToFront*s��������r/c�X�	|jj�y#t$rYywxYw�NTF)r?r�r*r_s r-�upgradez#UpdateManagerDbusController.upgrade/s,��	��K�K�%�%�'����	��	�s��	)�)c�F�|tjvrd|_yd|_yrG)r�NM_STATE_CONNECTED_LISTrB)r,�watcher�states   r-rAz-UpdateManagerDbusController._on_network_alert7s���(�@�@�@�!�D�N�"�D�Nr/N)r&)r8r9r:r;r1r(r0�methodr.rHrArr/r-r2r2s\��<�;�	
�
�\�\���=�>��?��
�\�\���=�>��?��#r/r2)C�
gi.repositoryrrrrrr�&uaclient.api.u.pro.packages.updates.v1�api�u�prorr��v1r��warnings�filterwarnings�DeprecationWarningr�r�r�r�r�r�r�r
r@r(�dbus.service�dbus.mainloop.glibrr�Dialogsrrrrrrrrrr�MetaReleaseGObjectrr�Core.AlertWatcherr�Core.MyCacher�	Core.roamr�Core.UpdateListr�
Core.utilsrr r!�backendr"r#r�r0r%r0r>r2rr/r-�<module>ras���.�%���!�3�3�3��������,�.@����	��
��� ���,�
�T�"�&����,�.�+�!�+�'�B�B�0�2��IN�C�J�J�IN�X #�$�,�,�"5�"5� #r/

Zerion Mini Shell 1.0