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

�

QKf%�����ddlZejdd�ddlmZddlmZddlmZddlmZddlmZdd	lmZddl	Z	e	jd
de�ddlZddl
Z
ddlZddlZddlZddlZddlmZdd
lmZddlmZmZddlmZddlmZddlmZddlmZddl m Z ddl!m!Z!e"d�\Z#Z$Z%Z&Z'ddl(m)Z)Gd�d�Z*Gd�dejV�Z,Gd�de�Z-y)�N�Gtkz3.0)�GLib)r)�Gdk)�GObject)�Gio)�Pango�ignorezAccessed deprecated property)�gettext)�ngettext�)�
humanize_size�SoftwarePropertiesPage)�AlertWatcher)�UpdateSystemGroup)�InternalDialog)�NotEnoughFreeSpaceError)�ChangelogViewer)�UnitySupport�)�NetworkManagerHelperc��eZdZd�Zy)�
UpdateDatac�6�|r|ng|_||_||_y�N)�groups�group�item)�selfrrrs    �@/usr/lib/python3/dist-packages/UpdateManager/UpdatesAvailable.py�__init__zUpdateData.__init__[s�� &�f�B�����
���	�N)�__name__�
__module__�__qualname__r �r!rrrZs��r!rc�*�eZdZdZdd�Zd�Zd�Zd�Zy)�CellAreaPackageaThis CellArea lays our package cells side by side, without allocating
    width for a cell if it isn't present (like icons for header labels).
    We assume that the last cell should be expanded to fill remaining space,
    and other cells have a fixed width.
    c�l�tjj|�||_d|_i|_yr)r�CellAreaBoxr �indent_toplevel�column�cached_cell_size)rr*s  rr zCellAreaPackage.__init__hs+����� � ��&�.������ "��r!c���g��fd�}|j|d�i}t��D]q\}}	t|	tj�r|	jd�}
|
du}nd}|||<|r�@||jvs�O|	j|�\}}
|
|j|<�s|j�}|j�}|jd�}|j|�}|j|jz}|j�}tjj|�j�}d}||_d|_
t!��dz
}t��D�]"\}}	||k(}|jj#|d�}|jdkDr'|dk(r"|xj|j|zz
c_|dk(r_|ds|j$r|dz
}|dkDrDt'd|dz
�}||z}|dk(r|}n|dk(r|dz}n||z}|xj||zz
c_|rt'|||jz
�}||s
||z|_
d}nd|_
||z}||	|j�|j��s��#yy)	Nc�(���j|�yr)�append)�cell�data�cellss  �r�gatherz0CellAreaPackage.do_foreach_alloc.<locals>.gatherss����L�L��r!�giconF�spacingrr��)�foreach�	enumerate�
isinstancer�CellRendererPixbuf�get_propertyr,�get_preferred_width�copy�get_cell_start�width�x�get_current_path_string�TreePath�new_from_string�	get_depth�len�getr*�max)r�context�widget�cell_area_in�
bg_area_in�callbackr3�cell_is_hidden�cell_numberr0r4�	hide_cell�min_size�natural_size�	cell_area�bg_arear5�
cell_start�orig_end�cur_path�depth�extra_cell_width�last_cell_number�is_last_cell�	cell_size�indent�indent_size�indent_extrar2s                            @r�do_foreach_allocz CellAreaPackage.do_foreach_allocns������	�	
���V�T�"���"+�5�!1�	B��K���$�� 6� 6�7��)�)�'�2��!�T�M�	�!�	�*3�N�;�'���D�4I�4I�!I�)-�)A�)A�&�)I�&��,�5A��%�%�k�2�	B�!�%�%�'�	��/�/�#���#�#�I�.���(�(��0�
��?�?�Y�[�[�0���/�/�1�����,�,�X�6�@�@�B���� �	���	���u�:��>��!*�5�!1�!	��K��&�*:�:�L��-�-�1�1�+�q�A�I�����"�'7�1�'<����y����8�8���a��%�a�(�T�-A�-A��Q�J�E��1�9� ��E�A�I�.�F�"+�f�"4�K���z�'.���!��'.��{��'.��'7���K�K�;��#=�=�K���	�8�i�k�k�+A�B�	�!�+�.�"+�.>�">�	��#$� �"#�	��#,�w�#6� ���i�n�n�.�����?��C!	r!c��|j|�}|j|jz|z
|_||_tjj||||||�Sr)r?r@rArr)�do_event)rrIrJ�eventrS�flagsrUs       rrbzCellAreaPackage.do_event�sX��
�(�(��0�
�#�/�/�I�K�K�7�*�D�	�� �	�����'�'��'�6�5�)�U�
�	
r!c���|jsytj�}|jt�|jd|�|j
�}|jd|�|j
�}|jj�|z
|z
}|js<|jd|�|jd�}||j
�zdz|z}|S)Nrzhorizontal-separatorzgrid-line-widthz
expander-sizer5�)
r+r�Value�init�int�style_get_property�get_int�get_x_offsetr*r<)rrJ�val�h_sep�
line_widthrUr5s       rr?zCellAreaPackage.get_cell_start�s����{�{���-�-�/�C��H�H�S�M��%�%�&<�c�B��K�K�M�E��%�%�&7��=�����J����1�1�3�e�;�j�H�J��'�'��)�)�/�3�?��+�+�I�6��'�#�+�+�-�7�!�;�g�E�
��r!N)F)r"r#r$�__doc__r r`rbr?r%r!rr'r'as���#�I�V

�r!r'c��eZdZdZd-d�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d �Z!d!�Z"d"�Z#d#�Z$d$�Z%d%�Z&d&�Z'd'�Z(d(�Z)d)�Z*d.d*�Z+d+�Z,d,�Z-y)/�UpdatesAvailablez/usr/share/app-install/iconsNc�^��tj�|�|�_|j�_|j�_|�_|�_|�_tjj�jd�}�j|d��j�j�d�_d�_d�_t"j$j'd��_t*j,j/��_�j0j3�j4�t7����_�j;��j=t*j>�jj@��_!�j=tEd��jF��_$�j=tEd��jJ��_&�jL�_'tQ��_)�jRjUt*jVjX��jRj[��j\j_�jR��jRja�}|jcd	tdjfjh�
�|jcdtdjfjh�
�|jcdtdjfjh�
�t+jjtltnjptltrtr��_:�jvjyd��jzj}�j�t*j�j��t+j��}|j�d
d�|j�dd�|j�dt*j�j��|j�dd�t+j�d|�}|j�t*j�j��|j�d��jvj�|�|j�|�j��t�d��_Nt*j�j��j��}	|	�j�_P|	j�tEd��|	j�dd�|	j�d��jvj�|	�t+j��}
|
j�dd�|
j�d�j��|	j�|
d�|	j�|
dt��|	j�|
dt��|	j�|
�j��t+j��}|j�dd�|j�dt*j�j��|	j�|d�|	j�|�j��t+j��}|j�dd�|j�dtdj�j��|	j�|d�|	j�|�j��t+j��}
|
j�d
d�|
j�dd�|
j�dd�|
j�dd�t+j�tEd �|
t��!�}|j�t*j�j��|j�|
dt���jvj�|��jvj�d��jvj�d��jvj�t*j�j���jvj�d��jvj�|	��jvj�t���jvj�d"�j���j(j�d#��_m�j(j�d$��_n�j�j��j(j�d%���j�j�d&�j���j�j�d'�j��t"j$j'd(��_s�j�j�d)�fd*���j��t���_v�j�j�d+�j���j�j�d,�j���j�j�d-�j��	dd.lzm{}|�j�}|rG�j�ja�j�|���j�jd�yy#t�$r�j�d/�}Y�fwxYw)0Nzgtkbuilder/UpdateManager.ui�pane_updates_availablerTzcom.ubuntu.update-manager)�parentzEnable Ubuntu Pro...zInstall Now�
versiontag)�weight�
changestag�descriptiontag�xpadrf�ypadr6z
stock-sizezfollow-state�FzInstall or remover5�toggled�active�	sensitive�	ellipsize��xalignr�scaleg�������?�Download)�textzbutton-press-eventz
show-versionszsummary-before-name�show-details�activateznotify::expandedzcom.ubuntu.update-notifierzchanged::auto-launchc�$���j�Sr)�update_close_button)�s�prs  �r�<lambda>z+UpdatesAvailable.__init__.<locals>.<lambda>}s����1I�1I�1K�r!z
network-alertz
battery-alertznetwork-3g-alert)�current_newsz+/var/lib/ubuntu-advantage/messages/apt-news)�rr �window_main�datadir�cache�
custom_header�custom_desc�need_reboot�os�path�join�_load_ui�set_content_widgetrt�dl_size�	connected�sleep_cookier�Settings�new�settingsr�	IconTheme�get_default�	app_icons�append_search_path�APP_INSTALL_ICONS_PATHr�unity�add_settings_button�
add_button�STOCK_CANCEL�close�button_close�_�on_button_pro_clicked�
button_pro�on_button_install_clicked�button_install�focus_buttonr�textview_changes�
set_wrap_mode�WrapMode�WORD�show�scrolledwindow_changes�add�
get_buffer�
create_tagr�Weight�BOLD�	TreeStore�strr�
TYPE_PYOBJECT�bool�store�treeview_update�	set_model�
image_restart�set_from_gicon�get_restart_icon�IconSize�BUTTONr;�set_property�MENU�TreeViewColumn�
set_sizing�TreeViewColumnSizing�FIXED�set_fixed_width�
append_column�set_cell_data_func�restart_icon_renderer_data_funcr'�
pkg_cell_area�
new_with_arear+�	set_title�
set_expand�CellRendererToggle�connect�on_update_toggled�
pack_start�
add_attribute�LIST_TOGGLE_ACTIVE�LIST_SENSITIVE�pkg_toggle_renderer_data_func�pkg_icon_renderer_data_func�CellRendererText�
EllipsizeMode�END�pkg_label_renderer_data_func�	LIST_SIZE�AUTOSIZE�set_headers_visible�set_headers_clickable�
set_direction�
TextDirection�LTR�set_fixed_height_mode�set_expander_column�set_search_column�	LIST_NAME�on_treeview_button_press�get_boolean�
show_versions�summary_before_name�expander_details�set_expanded�pre_activate_details�activate_details�notifier_settingsr�r�
alert_watcher�_on_network_alert�_on_battery_alert�_on_network_3g_alert�'uaclient.api.u.apt_news.current_news.v1r��ImportError�
_get_apt_news�news�set_text�
expander_news�set_visible)rr��header�descr��content_ui_path�changes_buffer�restart_icon_renderer�restart_column�
pkg_column�pkg_toggle_renderer�pkg_icon_renderer�pkg_label_renderer�
size_renderer�size_columnr��apt_newss`                rr zUpdatesAvailable.__init__�sC�������k�2�&���"�*�*��� �&�&��
�#������&����'�'�,�,��L�L�7�
��	
�
�
�o�'?�@����� ;� ;�<�������!������(�(�)D�E��
����2�2�4������)�)�$�*E�*E�F�"��.��
�	
� � �"� �O�O����d�.�.�4�4�
����/�/�
�$�%�t�'A�'A�
���#�o�o�
�m��d�<�<�
���!�/�/���!0� 1������+�+�C�L�L�,=�,=�>����"�"�$��#�#�'�'��(=�(=�>��.�.�9�9�;���!�!�,�u�|�|�7H�7H�!�I��!�!�,�u�|�|�7H�7H�!�I��!�!�"2�5�<�<�;L�;L�!�M��]�]�3��(=�(=�s�D�$�O��
����&�&�t�,����)�)��!�!�#�S�\�\�%8�%8�	
�!$� 6� 6� 8���*�*�6�1�5��*�*�6�1�5��*�*�<����9J�9J�K��*�*�>�4�@��+�+�D�2G�H���!�!�#�":�":�"@�"@�A��&�&�r�*����*�*�>�:��)�)�!�4�#G�#G�	
�-�U�3����'�'�5�5�d�6H�6H�I�
�$.����!����Q�2�3�4����	�1�-����d�#����*�*�:�6�!�4�4�6���(�(���3��#�#�I�t�/E�/E�F����1�5�9�� � ���+=�	
�	� � ���n�	
�	�%�%���!C�!C�	
� �2�2�4���&�&�v�q�1��&�&�|�S�\�\�5F�5F�G����/��7��%�%��t�?�?�	
�!�1�1�3���'�'���2��'�'��U�5H�5H�5L�5L�M����0�$�7��%�%��� A� A�	
��,�,�.�
��"�"�6�1�-��"�"�6�1�-��"�"�8�Q�/��"�"�7�I�6��(�(�
�j�M�=�y�
��	���s�7�7�@�@�A��!�!�-��n�M����*�*�;�7����0�0��6����2�2�5�9����*�*�3�+<�+<�+@�+@�A����2�2�5�9����0�0��<����.�.�y�9����$�$� �$�"?�"?�	
�
"�]�]�6�6��G���#'�=�=�#<�#<�!�$
�� �
	
���*�*��M�M�%�%�n�5�	
�	
���%�%�j�$�2K�2K�L����%�%��� 5� 5�	
�
"%���!1�!1�2N�!O������&�&�"�$K�	
�	
� � �"�*�^������"�"�?�D�4J�4J�K����"�"�?�D�4J�4J�K����"�"��� 9� 9�	
�	�L�#�~�2�2�H�
��I�I� � �"�+�+�H�5����*�*�4�0���	�	��)�)�=��H�	�s�.j�j,�+j,c�N�tj|�|j�yr)r�stop�_save_state�rs rrzUpdatesAvailable.stop�s�����D�!����r!c���tj|�|j|jj�|j
j
�|j�yr)r�start�set_update_listr��update_listr��check_alert_state�_restore_staters rrzUpdatesAvailable.start�sH�����T�"����T�-�-�9�9�:����,�,�.����r!c�J�tjjd�}|dk\S)Nz#APT::Periodic::Update-Package-Listsr)�apt_pkg�config�find_i)r�update_dayss  r�is_auto_updatezUpdatesAvailable.is_auto_update�s&���n�n�+�+�1�
���a��r!c��|j�r[|jjtd��|jj	d�|jjd�y|jjtj�|jj	d�|jjd�y)Nz_Remind Me LaterFT)rr��	set_labelr��
set_use_stock�set_use_underlinerr�rs rr�z$UpdatesAvailable.update_close_button�s������ ����'�'��*<�(=�>����+�+�E�2����/�/��5����'�'��(8�(8�9����+�+�D�1����/�/��6r!c�F�|jd�|j�yr)�select_all_upgradesr�)r�menu�menuitemr1s    r�install_all_updatesz$UpdatesAvailable.install_all_updates�s��� � ��&��&�&�(r!c�t�|�|j�y|jjjd�}|dk(S)NFzRestart-Required�system)�	candidate�recordrG)r�pkg�restart_conditions   r�pkg_requires_restartz%UpdatesAvailable.pkg_requires_restart�s:���;�#�-�-�/���M�M�0�0�4�4�5G�H�� �H�,�,r!c�H�gd�}tjj|�S)N)zview-refresh-symboliczsystem-restartz
system-reboot)r�
ThemedIcon�new_from_names)r�restart_icon_namess  rr�z!UpdatesAvailable.get_restart_icon�s"��
��
�~�~�,�,�-?�@�@r!c�^�|j|t�}|j|t�}|j|�}|j	|�d}	|j
r<|j
jr&|j|j
j�}	nn|jrb|jj|�sG|jjD].}
|
js�|j|
j�s�,d}	n|	r|j�}nd}|jd|�y)NFTr4)�	get_value�LIST_UPDATE_DATAr��get_path�
set_sensitiverr+r-rr��row_expanded�itemsr�r�)r�cell_layout�renderer�model�iter�	user_datar1rr��requires_restart�
group_itemr4s            rr�z0UpdatesAvailable.restart_icon_renderer_data_func�s������t�%5�6���O�O�D�.�9�	��~�~�d�#�����y�)� ���9�9������#�8�8������G��
�Z�Z��'�'�4�4�T�:�"&�*�*�"2�"2��J�!�~�~�$�*C�*C�"���+�,0�(�����)�)�+�E��E����g�u�-r!c�P�|j|t�}d}d}|jr^|jjj|j
jv}d}|j|jj�n~|jrd}|jj�}nU|jrId}d}d}	|jD]4}
|
jD]}|j�}|	�	|	|k7rd}n|}	�!|s�4n|jd|�|jd|�y)NFT�activatable�inconsistent)r3r4rr+�name�list�	held_backr6rr�selection_is_inconsistentrr8�is_selectedr�)
rr9r:r;r<r=r1rArB�saw_installrr�this_installs
             rr�z.UpdatesAvailable.pkg_toggle_renderer_data_func�s�����t�%5�6�������9�9��)�)�-�-�,�,�D�I�I�4G�4G�G�K� �L��"�"�4�9�9�#6�#6�7�
�Z�Z��K��:�:�?�?�A�L�
�[�[��K� �L��K����
��!�K�K�/�D�#'�#3�#3�#5�L�"�.�;�,�3N�'+���".�K�/� ��
�	���m�[�9����n�l�;r!c��|j|t�}d}|jr&|j|jj�}n1|j
r%|j|j
j�}|j
d|�y)Nr4)r3r4r�get_app_install_icon�iconrr�)rr9r:r;r<r=r1r4s        rr�z,UpdatesAvailable.pkg_icon_renderer_data_func�sh�����t�%5�6�����:�:��-�-�d�j�j�o�o�>�E�
�Y�Y��-�-�d�i�i�n�n�=�E����g�u�-r!c�\�t|tj�s|S|jj	|j�dtjj�}|�Jtjjtjj|j���S|S)z�Any application icon is coming from app-install-data's desktop
        files, which refer to icons from app-install-data's icon directory.
        So we look them up here.�)r:rr/r��choose_icon�	get_namesr�IconLookupFlags�
FORCE_SIZE�FileIconr��File�new_for_path�get_filename)rrL�infos   rrKz%UpdatesAvailable.get_app_install_icons��
�$����/��K��~�~�)�)��N�N��b�#�"5�"5�"@�"@�
�����<�<�#�#�C�H�H�$9�$9�$�:K�:K�:M�$N�O�O��Kr!c�:�|j|t�}|j|t�}tj|j|t
��}|j
|�|jr|}	n|jr|}	nd|z}	|jd|	�y)Nz	<b>%s</b>�markup)
r3r4r�r�markup_escape_textr�r6rrr�)
rr9r:r;r<r=r1rrCrYs
          rr�z-UpdatesAvailable.pkg_label_renderer_data_funcs������t�%5�6���O�O�D�.�9�	��&�&�u���t�Y�'G�H�����y�)��:�:��F�
�Y�Y��F� �4�'�F����h��/r!c��|jd�|j|j�dd�|j|j�|dz�|j	d�}t|�dk(r|j|�y|D]�}|j�}t
jdt
j|�z|�}	t
jd|�}
t
jd	|�}|	r3|	jd�}td
�|z}
|j||
d���|r|j||dzd���|
r��|j||dz���y)
N�zTechnical description
ryz

�
rz^%s \((.*)\)(.*)\;.*$z^.*--.*<.*@.*>.*$z^Changes for [^ ]+ versions:$z
Version %s: 
rvrx)r��insert_with_tags_by_name�get_end_iter�insert�splitrF�re�match�escaperr�)rr�	long_descr�rC�srcpkg�lines�line�end_iter�
version_match�author_match�
changes_match�version�version_texts              r�set_changes_bufferz#UpdatesAvailable.set_changes_buffer.sU������#�	�/�/��0K�0K�0M�0I�0@�	B�	���n�9�9�;�'�&�0�	2��
�
�4� ���u�:��?��#�#�D�)���	=�D�%�2�2�4�H��H�H�(�2�9�9�V�+<�<�d��M��8�8�$7��>�L��H�H�%E�t�L�M��'�-�-�a�0�� �!1�2�W�<���7�7��l�L����7�7��d�T�k�<�����%�%�h��t��<�-	=r!c�D
�|j�d}|�y|j�}|j|�}|j|t�}|j
}|�8|j�,|jj�|jj}|�B|j�6|jj� |jjj�,|jj�}|jd�y|jjj}tjdtj �}	|	j#d|�}tjdtj �}	|	j#d|�}tjdtj �}	|	j#d|�}d	|jj$�d|��}|jj$}
|
�y|jj�}|
|j&j(vrS|j&j(|
}|j&|
jj*}|j-||||
|��n�|j.s|jt1d
���n�|j2j5��r�t7j8�}
|
j;�t7j<|j&j>|
|
f��}|jA�|jdt1d
�z�|jCd�}|jE|�}tGjHd��}|jjK||�|jM�|jOdd�|
�}|
jQ�rctSjTd�tGjV�r)tGjX�tGjV�r�)|
jQ�r�c|j[�|j]|�r|j_|�|j�d}|�y||k7ryd}|j&|
jj*}|
|j&j`vr||j&j`|
z
}|
|j&j(vr||j&j(|
z
}|s|r|j-||||
|�yy)Nrr\z^(\s|\t)*(\*|0|-)z
*z\n� z\s\s+r]z	Package: zKNo network connection detected, you can not download changelog information.)�target�argsz%s
zDownloading list of changes...rz
gtk-cancel)�stock�clickedc�"�|j�Sr)�release)�w�locks  rr�zDUpdatesAvailable.on_treeview_update_cursor_changed.<locals>.<lambda>�s��4�<�<�>�r!g{�G�z�?)1�
get_cursor�	get_model�get_iterr3r4rr�	core_itemr+r)�descriptionr�r�r�rb�compile�	MULTILINE�subrCr��all_changes�source_nameror�r�r��get_expanded�	threading�Lock�acquire�Thread�get_news_and_changelogr�get_iter_at_line�create_child_anchorr�Button�add_child_at_anchorr�r��locked�time�sleep�events_pending�main_iteration�hide�handler_is_connected�
disconnect�all_news)rrJr�r;r<r1rrrer�rC�changesrfry�changelog_thread�anchor�button�id�now_paths                   r�!on_treeview_update_cursor_changedz2UpdatesAvailable.on_treeview_update_cursor_changedWs)��� � �"�1�%���<��� � �"���~�~�d�#�����t�%5�6���y�y���L��
�
�&��
�
�$�$�0��:�:�'�'�D��L��x�x���x�x�!�!�)��x�x�!�!�-�-�5�!�2�2�=�=�?�N��#�#�B�'���H�H�&�&�2�2�	�
�J�J�+�R�\�\�:���E�E�%��+�	��J�J�u�b�l�l�+���E�E�#�y�)�	��J�J�x����.���E�E�$�	�*�	�)-�����	�B�	��x�x�}�}���<���.�.�9�9�;���4�:�:�)�)�)��j�j�,�,�T�2�G��Z�Z��%�/�/�;�;�F��#�#�N�I�w��$*�
,�����#�#��-��
��
"�
"�
/�
/�
1��>�>�#�D��L�L�N�(�/�/��z�z�8�8��d�|� ��
�"�"�$��#�#���;�<�<�
�"�2�2�1�5�D�#�7�7��=�F��Z�Z�l�3�F��!�!�5�5�f�f�E��K�K�M�����9�4��B��+�+�-��
�
�4� ��(�(�*��&�&�(��(�(�*��+�+�-�

�K�K�M��*�*�2�.��!�!�"�%��$�$�&�q�)������8��������D�!�+�+�7�7���4�:�:�&�&�&��t�z�z�*�*�4�0�0�G��4�:�:�)�)�)��t�z�z�-�-�d�3�3�G��i��#�#�N�I�w��$*�
,� r!c	� �|jtjjk(�rf|jdk(�rUtj�x|_}t
jjtd��}|jd|j�|j|�|jj|jj z}|dk(r|j#dd�t
jjtd��}|jd|j$�|j|�|j'�|j)ddddd|j|j*�|j-�y	yy)
zW
        Show a context menu if a right click was performed on an update entry
        r7z
_Deselect Allr�rrFzSelect _AllNT)�typer�	EventType�BUTTON_PRESSr�r�Menur$�MenuItem�new_with_mnemonicr�r��select_none_upgradesr/r��
install_count�	del_countr�r#�show_all�popup_for_devicer�r�)rrJrcr$�item_select_none�num_updates�item_select_alls       rr�z)UpdatesAvailable.on_treeview_button_press�s1���:�:����3�3�3�����8I� #�x�x�z�)�D�I��"�|�|�=�=��/�"� ��
�$�$�Z��1J�1J�K��K�K�(�)��*�*�2�2�T�Z�Z�5I�5I�I�K��a�� �-�-�k�5�A�!�l�l�<�<�Q�}�=M�N�O��#�#�J��0H�0H�I��K�K��(��M�M�O��!�!��d�D�$��e�l�l�E�J�J�
�
�I�I�K��+9J�3r!c��tj|tj�r%t|�5}|j	�cddd�Sy#1swYyxYwr)r��access�R_OK�open�read)r�
apt_news_file�fs   rr�zUpdatesAvailable._get_apt_news�sF��
�9�9�]�B�G�G�,��m�$�
 ���v�v�x�
 �
 �-�
 �
 �s�A�Ac��|jj�}|D]\}|j|jt�}|j
�
|j��<|j|jt|��^y)z2small helper that will set/unset the group headersN)	r�r{r3r<r4rr�	set_valuer�)r�new_selection_valuer;�rowr1s     r�_toggle_group_headersz&UpdatesAvailable._toggle_group_headers�sf���$�$�.�.�0���	�C��?�?�3�8�8�-=�>�D��{�{�&�$�*�*�*@�����H�H�0�2E��	r!c���|jd�|jj�|jd�|jj�|j
�|jd�y)z$
        Select all updates
        TFN)�setBusyr��saveDistUpgrader�r��
queue_draw�updates_changed�rrJs  rr#z$UpdatesAvailable.select_all_upgrades�sX��	
���T���
�
�"�"�$��"�"�4�(����'�'�)��������U�r!c���|jd�|jj�|jd�|jj�|j
�|jd�y)z%
        Select none updates
        TFN)r�r��clearr�r�r�r�r�s  rr�z%UpdatesAvailable.select_none_upgrades�sX��	
���T���
�
�����"�"�5�)����'�'�)��������U�r!c���|jj��y|r_|jj�jtjjtjj��n)|jj�jd�tj�r*tj�tj�r�)yy)z�Show a watch cursor if the app is busy for more than 0.3 sec.
        Furthermore provide a loop to handle user interface eventsN)r��
get_window�
set_cursorr�Cursorr��
CursorType�WATCHrr�r�)r�flags  rr�zUpdatesAvailable.setBusys������&�&�(�0������'�'�)�4�4��
�
���s�~�~�3�3�4�
�
���'�'�)�4�4�T�:�� � �"���� �� � �"r!c�B�d�}|jj|d�y)Nc��|j|t�}d}|jr|jj�}nd|jr|jj�}n=|jr1t|jD�cgc]}|j���c}�}|j|t|�ycc}w)NF)
r3r4rrGr�packages_are_selectedr�anyr�r�)r;r�r<r1r~�gs      r�
foreach_cbz;UpdatesAvailable._mark_selected_updates.<locals>.foreach_cbs����?�?�4�)9�:�D��F��y�y����.�.�0��������9�9�;���������M�A�a�5�5�7�M�N���O�O�D�"4�f�=��Ns�B<)r�r8)rr�s  r�_mark_selected_updatesz'UpdatesAvailable._mark_selected_updatess��		>�	
�
�
���:�t�,r!c����d���fd�}�jj|d��jj��y)NFc�`��|j|t�}|j|t�}|syd}|jr|jj}nB|j
r6|j
jr |j
jj}|r�j|�rd�yyy)NT)r3r4r�rr+rr}r-)r;r�r<r1r~r+r>rs      ��rr�z@UpdatesAvailable._check_for_required_restart.<locals>.foreach_cb#s�����?�?�4�)9�:�D��_�_�T�+=�>�F����C��y�y��i�i�m�m������
�
� 4� 4��j�j�*�*�.�.���t�0�0��5�#'� �6�sr!)r�r8�hbox_restartr)rr�r>s` @r�_check_for_required_restartz,UpdatesAvailable._check_for_required_restart s9��� ��	(�	
�
�
���:�t�,����%�%�&6�7r!c��|jj|jj|jjz�	|jj|jjz}|jj
|_d}|jdk7r�td�t|j�z}|jjd�|jjd�|jjd�|jj��n+|dkDr^tdd|�}|jjd�|jjd�|jj�n�|jj r<|jj"s&td�}|jj�n[td�}|jjd	�|jjd	�|jj�|jjd	�|j$j'|�|j(j+�|j,j+�y#t.$r�}t1d
|z�|j$j3td��|jjd	�|j(j+�|j,j+�Yd}~yd}~wwxYw)Nr\rz%s will be downloaded.Tz'The update has already been downloaded.z)The updates have already been downloaded.z7You need to enable Ubuntu Pro to install these updates.z There are no updates to install.Fz-required_download could not be calculated: %szUnknown download size.)r�r6r�r�r��required_downloadr�r�r
�image_downsizer��set_install_menuitem_visibler��destroyrrD�ubuntu_pro_fake_groups�ubuntu_pro_groups�label_downsizer��
hbox_downsizer��vbox_alerts�SystemError�print�
set_markup)r�
inst_count�download_str�es    r�_refresh_updates_countz'UpdatesAvailable._refresh_updates_count4sn�����)�)��J�J�$�$�t�z�z�';�';�;�	
�/	$����1�1�D�J�J�4H�4H�H�J��:�:�7�7�D�L��L��|�|�q� � �!9�:�!�$�,�,�/� ���#�#�1�1�$�7��#�#�1�1�$�7��
�
�7�7��=����'�'�)���>�#+�A�C�"�$�L�
�'�'�5�5�d�;��J�J�;�;�D�A��O�O�+�+�-��i�i�6�6�"�i�i�9�9�#$�&7�$8�L��'�'�/�/�1�#$�%G�#H�L��'�'�5�5�e�<��J�J�;�;�E�B��O�O�+�+�-��#�#�1�1�%�8����(�(��6����#�#�%����!�!�#���	$��A�A�E�F����*�*�1�-E�+F�G����-�-�e�4����#�#�%����!�!�#�#��	$�s�I!J*�*	L>�3BL9�9L>c�d�|j�|j�|j�yr)r�r�r�rs rr�z UpdatesAvailable.updates_changedis&���#�#�%��(�(�*��#�#�%r!c��|j�d}d}|j�|j}|j�
|j}n�|jj	d�rm|j
jj}|j
jj}td�||fz}|jjdd�n<td�}|jj�s|jrtd�}|jjd�|j!|�|j#|�y)zjactivate or disable widgets and show dialog texts corresponding to
        the number of available updatesNz	first-runzYUpdated software has been issued since %s %s was released. Do you want to install it now?FzOUpdated software is available for this computer. Do you want to install it now?zIThe computer also needs to restart to finish installing previous updates.T)r�r�r�r�r�r��meta_release�flavor_name�current_dist_versionr��set_booleanr��get_visibler�r�r6�
set_header�set_desc)r�text_header�	text_desc�flavorrms     r�update_countzUpdatesAvailable.update_countns)��	
�������	����)��,�,�K����'��(�(�I��]�]�
&�
&�{�
3��%�%�2�2�>�>�F��&�&�3�3�H�H�G��?����!�"�K�
�M�M�%�%�k�5�9��;��K��$�$�0�0�2�t�7G�7G��=��	�
	
���*�*�4�0�����$��
�
�i� �r!c�^�|jj�}|r|j�yyr)r�r�r)r�expander�expandeds   rr�z%UpdatesAvailable.pre_activate_details�s*���(�(�5�5�7�������r!c���|jj�}|jjd|�|r|j	|j
�|j
�y)Nr�)r�r�r�r�r�r�r)rr�r1r�s    rr�z!UpdatesAvailable.activate_details�sM���(�(�5�5�7���
�
�!�!�.�(�;���2�2�4�3G�3G�H����r!c��yrr%)rr�r1s   r�
activate_desczUpdatesAvailable.activate_desc�s��r!c�V�|jjtj�yr)r��
show_settingsr�
ubuntu_prors rr�z&UpdatesAvailable.on_button_pro_clicked�s�����&�&�'=�'H�'H�Ir!c	��|jjd�td�}td�}td�}td�}td�}td�}td�}	|jj	�|jj%�y#t
$�r�}tjjd	�}	d}
|jD�]h}|
dk7r|
d
z
}
|j|	k(r6|
||j|j|j|j|fzz
}
�S|jdk(r6|
||j|j|j|j|fzz
}
��|jdk(r6|
||j|j|j|j|fzz
}
��|jd
k(r7|
||j|j|j|j|fzz
}
��#|jdk(s��4|
||j|j|j|j|fzz
}
��k|jjd||
�Yd}~yd}~wt$rt!j"d�Y��wxYw)NFzNot enough free disk spacezxThe upgrade needs a total of %s free space on disk '%s'. Please free at least an additional %s of disk space on '%s'. %szIRemove temporary packages of former installations using 'sudo apt clean'.z�You can remove old kernels using 'sudo apt autoremove', and you could also set COMPRESS=xz in /etc/initramfs-tools/initramfs.conf to reduce the size of your initramfs.z^Empty your trash and remove temporary packages of former installations using 'sudo apt clean'.z!Reboot to clean up files in /tmp.r\zDir::Cache::archivesrqz/boot�/z/tmpz/usrzfree space check failed)r�r�r�r��checkFreeSpacerrr�find_dir�free_space_required_list�dir�
size_total�size_neededr��start_errorr��logging�	exception�
start_install)r�err_sum�err_msg�remedy_archivedir�remedy_boot�remedy_root�
remedy_tmp�
remedy_usrr��
archivedir�err_long�reqs            rr�z*UpdatesAvailable.on_button_install_clicked�sw���
�
�/�/��6��0�1���
N�
��
�
4�
���
5�
��
�
>�
���:�;�
��r�U�
�4	9��J�J�%�%�'�h	
���&�&�(��g'�0	� ���0�0�1G�H�J��H��1�1�*
���r�>���O�H��7�7�j�(���������������)�+�!��H��W�W��'���������������#�+�!��H��W�W��^���������������#�+�!��H��W�W��&���������������"�+�!��H��W�W��&���������������"�+�!��H�I*
�V
���(�(����B����	9����7�8�	9�s&�*B�
J	�)EI$�
AI$�$!J	�J	c���|tjvrp|jjt	d��|j�|jj�|jj�d|_	y|tjvs|tjk(rM|j�|jj�d|_	|j|j�yd|_	|jjt	d��|j�|jj�|jj�y)Nz
Connecting...FTzAYou may not be able to check for updates or download new updates.)r�NM_STATE_CONNECTING_LIST�
label_offliner�r�r��hbox_offliner�r�r��NM_STATE_CONNECTED_LIST�NM_STATE_UNKNOWNr�r�r�)r�watcher�states   rr�z"UpdatesAvailable._on_network_alert�s���(�A�A�A����'�'��/�(:�;�� � �"����"�"�$����!�!�#�"�D�N�
�)�A�A�A��,�=�=�=�� � �"����"�"�$�!�D�N�
�2�2�4�3G�3G�H�"�D�N����'�'��7��
�
� � �"����"�"�$����!�!�#r!c��|r5|jj�|jj�y|jj�yr)�hbox_batteryr�r�r�)rr�
on_batterys   rr�z"UpdatesAvailable._on_battery_alerts;������"�"�$����!�!�#����"�"�$r!c�H�|r5|jj�|jj�y|r5|jj�|jj�y|jj�|jj�yr)�hbox_roamingr��
hbox_on_3gr�)rr�on_3g�
is_roamings    rr�z%UpdatesAvailable._on_network_3g_alertsn������"�"�$��O�O� � �"�
��O�O� � �"����"�"�$��O�O� � �"����"�"�$r!c��|jj|�}|jj|t�}|jr=|j|jD��cgc]}|jD]}|���c}}�y|jr&|j|jj�y|j|jg�ycc}}w)z+a toggle button in the listview was toggledN)	r�r|r3r4r�toggle_from_itemsr8rr)rr:r�r<r1rrs       rr�z"UpdatesAvailable.on_update_toggled+s����z�z�"�"�4�(���z�z�#�#�D�*:�;���;�;��"�"�#'�;�;�G�%�5�;�;�G�4��G��G�
��Z�Z��"�"�4�:�:�#3�#3�4��"�"�D�I�I�;�/��Hs�"C
c�(�|jd|�y)zj
        If an update row was activated (by pressing space), toggle the
        install check box
        N)r�)r�treeviewr�r+rss     r� on_treeview_update_row_activatedz1UpdatesAvailable.on_treeview_update_row_activated:s��
	
���t�T�*r!c�>�|jd�tj|jj�}t|D�cgc]}|j
���c}�}|D]�}	|r|jj�nm|jj|jjvrA|js|jj�n|jj���|jjj r9tj"|jj�}|j%�|j'�|j(j+�~|jd�ycc}w#t$rY��7wxYw)NTF)r�r�ActionGroupr��	_depcacher�rGr+�	mark_keeprCrDrE�	to_remove�mark_install�mark_deleter��broken_count�ProblemResolver�resolve_by_keepr�r�r�)rr8�actiongroupr�
keep_packages�Fixs      rr!z"UpdatesAvailable.toggle_from_itemsAs3�����T���)�)�$�*�*�*>�*>�?���E�B�D�T�-�-�/�B�C�
��
	�D�	
� ��H�H�&�&�(��X�X�]�]�$�)�)�*=�*=�=��>�>����-�-�/����,�,�.��
	��:�:���,�,��)�)�$�*�*�*>�*>�?�C����!��������'�'�)�����U���)C���
��
�s�F
�(B
F�	F�Fc���|jj�rV|jj�\}}|jjd|�|jjd|�yy)z%save the state  (window-size for now)�window-width�
window-heightN)r�r�r��get_sizer��set_int)rrx�hs   rrzUpdatesAvailable._save_state\sY��� � �-�-�/��%�%�.�.�0�F�Q���M�M�!�!�.�!�4��M�M�!�!�/�1�5�0r!c��|jjd�}|jjd�}|jj�}|r|jj||�y|jj
�y)z'restore the state (window-size for now)r3r4F)r�rkr�r�r��begin_user_resizable�end_user_resizable)rrxr7r�s    rrzUpdatesAvailable._restore_statecss���M�M�!�!�.�1���M�M�!�!�/�2���(�(�5�5�7������1�1�!�Q�7��
���/�/�1�r!c��d}|D]}||j�z}�|t|dd�t|�d|g}|jj	d|�S)NrT)�get_total_sizerr
r�r/)rrCrr�
total_sizer�
header_rows       r�_add_headerzUpdatesAvailable._add_headernsh���
��	=�E�#�e�&:�&:�&<�<�J�	=�
��v�t�T�*��*�%���
�
��z�z� � ��z�2�2r!c��|D�]t}|js�d}t|t�s't|j�dk(r|jd}|jdk(rd|_|j}t|j�dkDr$d|jt|j�fz}|td||�t
|j��d|jg}|jjd|�}|r��|jD]l}|jtdd|�t
t|jjdd��d|jg}|jj||��n��wy)NrrzUbuntu basezSystem componentsz%s (%d)T�size)r8r:rrFrCrr
r<rr�r/�getattrr+r))	rrr�
group_is_itemrC�	group_row�
group_iterr�item_rows	         r�_add_groupszUpdatesAvailable._add_groups{sM���$	8�E��;�;�� �M��u�&7�8�����$��)� %���A��
��z�z�]�*�0��
��:�:�D��5�;�;��!�#� �E�J�J��E�K�K�0@�#A�A����4��
�6��e�2�2�4�5������I����*�*�4��;�J������
8���I�I��t�T�4�0�!�'�$�(�(�*<�*<�f�a�"H�I���O�O����
�
�!�!�*�h�7�
8�9$	8r!c�	�||_|jd�|jjd�|jj�d|_|jj�|jjrT|jtd�|jj�|j|jj�|jjrT|jtd�|jj�|j|jj�|jjrT|jtd�|jj�|j|jj�|jjrT|jtd�|jj�|j|jj�|jj rT|jtd�|jj �|j|jj �|jj"rV|jtd�|jj"d�	�|j|jj"�|jj$rV|jtd
�|jj$d�	�|j|jj$�|jj|j�t'|jj$�xs�t'|jj"�xs�t'|jj�xsat'|jj�xs@t'|jj�xst'|jj �|j(_|j-�|j/�|jd�t1j2�r)t1j4�t1j2�r�)|j7�y)NTrzImproved hardware supportzSecurity updatesz
Other updatesz#Unused kernel updates to be removedz Duplicate packages to be removedzUbuntu Pro security updates)ru3Ubuntu Pro security updates (enable in Settings…)F)rDr�r�r�r�r�r��scrolledwindow_updater��
oem_groupsr?r�rG�security_groups�
update_groups�kernel_autoremove_groups�duplicate_groupsr�r�r�r�r*r�r�rr�r�r�)rrs  rrz UpdatesAvailable.set_update_list�sq����	�	
���T�����&�&�t�,��
�
��������"�"�'�'�)��9�9�������-�.��	�	�0D�0D�
�
���T�Y�Y�1�1�2��9�9�$�$����Q�1�2�D�I�I�4M�4M�N����T�Y�Y�6�6�7��9�9�"�"����Q��/����1H�1H�I����T�Y�Y�4�4�5��9�9�-�-�����7�8��	�	�2�2�
�
���T�Y�Y�?�?�@��9�9�%�%�����4�5��	�	�*�*�
�
���T�Y�Y�7�7�8��9�9�&�&�����/�0��	�	�+�+��
�
�

���T�Y�Y�8�8�9��9�9�+�+�����G�H��	�	�0�0��
�
�

���T�Y�Y�=�=�>����&�&�t�z�z�2�����1�1�2�
0��D�I�I�/�/�0�
0��D�I�I�+�+�,�
0��D�I�I�-�-�.�
0��D�I�I�6�6�7�	
0�
�D�I�I�.�.�/�
	
���*�	
� � �"��������U��� � �"���� �� � �"�����r!)NNF)T).r"r#r$r�r rrrr�r&r-r�r�r�r�rKr�ror�r�r�r�r#r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r$r!rrr?rGrr%r!rrrrr�s���;��w1�r�� �7�)�-�A�.�8<�B.�� 0�$'=�Rj,�X�6 ��	�	�!�-�8�(3$�j&�
%�P�
��J�N)�`$�@%�
%�
0�+��66�	�3�*8�XCr!rr).�gi�require_version�
gi.repositoryrrrrrr�warnings�filterwarnings�DeprecationWarningrr�rbrr�r�r
r�r�
Core.utilsr
r�Core.AlertWatcherr�Core.UpdateListr�Dialogsr�DistUpgrade.DistUpgradeCacherrr�ranger�r4r�r�r��	Core.roamrrr)r'rrr%r!r�<module>r\s���@
�����5�%� ����!���������,�.@���	�	���� ��=�+�.�#�@�,�&�"
�!�H�
�
��
���,���t�c�o�o�t�nR�~�Rr!

Zerion Mini Shell 1.0