%PDF- %PDF-
Mini Shell

Mini Shell

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

�

4��e����F�ddlZdZ	ejdd�ddlmZdZddlm	Z	dd	lm
Z
dd
lmZddlmZddlm
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZd
dlmZmZd
dlmZmZmZmZd
dlmZd
dl m!Z"d
dl#m$Z$ddl%Z%d
dl&m%Z'Gd�dejPjRjT�Z+Gd�dejPjRjX�Z-Gd�de�Z.Gd�de�Z/Gd�de0�Z1Gd�de0�Z2Gd �d!ee$�Z3e4d"k(�r3e3�Z5e.e5�Z6e/e5�Z7e5jq�jsgd#��e	jt�ejvd�ejx�Z=ej|d
dD]8Z?e=e?j�re=e?j���&e=e?j���:e=j�e6e7�e	jt�e7j�d$d%�e5jq�jsgd#��e5j�d&d'd(�e5j�d)gd*�yy#e$rBejdd�ddlmZejjej_Y��|wxYw)+�NF�Vtez2.91)rTz2.90)�Gtk)�Gdk)�GLib)�GObject)�Pango�)�
run_apport�apport_crash)�DistUpgradeView�FuzzyTimeToStr�InstallProgress�AcquireProgress)�DistUpgradeConfig)�get)�SimpleGtkbuilderApp)�gettextc�(�eZdZdZd�Zd�Zd�Zd�Zy)�GtkCdromProgressAdapterzi Report the cdrom add progress
        Subclass this class to implement cdrom add progress reporting
    c�V�|j|_|j|_||_y�N)�label_status�status�progressbar_cache�progress�parent��selfrs  �A/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeViewGtk3.py�__init__z GtkCdromProgressAdapter.__init__Ds#���)�)����0�0��
����c�0�|r|jj|�|jj|jt|j�z�tj�r*tj�tj�r�)yy)z; update is called regularly so that the gui can be redrawn N)
r�set_textr�set_fraction�value�float�
totalStepsr�events_pending�main_iteration)r�text�steps   r�updatezGtkCdromProgressAdapter.updateHsa����K�K� � ��&��
�
�"�"�4�:�:�e�D�O�O�.D�#D�E�� � �"���� �� � �"r!c��y)N)F���rs r�ask_cdrom_namez&GtkCdromProgressAdapter.ask_cdrom_nameOs��r!c��y)NFr/r0s r�change_cdromz$GtkCdromProgressAdapter.change_cdromQs��r!N)�__name__�
__module__�__qualname__�__doc__r r,r1r3r/r!rrr@s����!��r!rc�,��eZdZd�Zd�fd�	Zd�Z�xZS)�
GtkOpProgressc� �||_d|_y)N�)�progressbar�fraction)rr<s  rr zGtkOpProgress.__init__Vs��&�����
r!c�T��tt|�|�|jdz}t	|j
|z
�dkDr,||_|jj|j
�tj�r*tj�tj�r�)yy)N�Y@皙�����?)�superr9r,�percent�absr=r<r$rr(r))rrB�new_fraction�	__class__s   �rr,zGtkOpProgress.update\s}���
�m�T�)�'�2�
�|�|�E�)���t�}�}�\�)�*�S�0�(�D�M����)�)�$�-�-�8�� � �"���� �� � �"r!c�:�|jjd�y)N� )r<r#r0s r�donezGtkOpProgress.doneis�����!�!�#�&r!r)r4r5r6r r,rH�
__classcell__�rEs@rr9r9Us����!�'r!r9c�D��eZdZ�fd�Zd�Zd�Z�fd�Zd�Z�fd�Z�xZ	S)�GtkAcquireProgressAdapterc���tt|��|j|_|j
|_||_d|_|j|_
|jjd|j�y)NF�clicked)
rArLr rrrrr�canceled�button_fetch_cancel�
button_cancel�connect�
cancelClicked)rrrEs  �rr z"GtkAcquireProgressAdapter.__init__qsc���
�'��7�9��)�)����0�0��
������
�#�7�7������"�"�9�d�.@�.@�Ar!c�<�tjd�d|_y)NrST)�logging�debugrO)r�widgets  rrSz'GtkAcquireProgressAdapter.cancelClickedzs���
�
�o�&���
r!c���td�||fz}tj|jjtj
jtjjtjj��}|j|�|j�}|jd�|j�|tjj k(ryy)Nz&Please insert '%s' into the drive '%s'�r�flags�type�buttonsr.TF)�_r�
MessageDialogr�window_main�DialogFlags�MODAL�MessageType�QUESTION�ButtonsType�	OK_CANCEL�
set_markup�run�	set_title�destroy�ResponseType�OK)r�medium�drive�msg�dialog�ress      r�media_changez&GtkAcquireProgressAdapter.media_change}s����8�9�V�E�N�J���"�"�$�+�+�*A�*A�),���)>�)>�(+���(@�(@�+.�?�?�+D�+D�F��	���#���j�j�l������������#�"�"�%�%�%��r!c����tt|��|jj	d�|j
j
�|jj
�y)Nr)rArL�startrr$r�showrQ)rrEs �rrszGtkAcquireProgressAdapter.start�sE���
�'��4�6��
�
�"�"�1�%������������!r!c��|jjd�|jjtd��|jj�y)NrGzFetching is complete)rr#rr]rQ�hider0s r�stopzGtkAcquireProgressAdapter.stop�s>���
�
���s�#������Q�5�6�7������!r!c���tt|�|�t|j|j
j
�dzz
�dkD�rp|j
j|jdz�|jdz}||jkDr|j}|jdkDr�tj|j�}t|t�r#|jt!j"��}|j$j't)d�||j|fz�|j
j't)d�t+|j,�z�nN|j$j't)d�||jfz�|j
j'd�t/j0�r)t/j2�t/j0�r�)|j4S)	Nr?r@r	rz!Fetching file %li of %li at %sB/s�About %s remainingzFetching file %li of %liz  )rArL�pulserCrBr�get_fractionr$�
current_items�total_items�current_cps�apt_pkg�size_to_str�
isinstance�bytes�decode�locale�getpreferredencodingrr#r]r
�etarr(r)rO)r�owner�currentItemr~rEs    �rrzzGtkAcquireProgressAdapter.pulse�s����
�'��4�U�;��t�|�|�D�M�M�6�6�8��>�>�?�#�E��M�M�&�&�t�|�|�E�'9�:��,�,�q�0�K��T�-�-�-�"�.�.�����!�#�%�1�1�$�2B�2B�C���k�5�1�"-�"4�"4��3�3�5�#7�K����$�$�Q�'J�%K���!1�!1�;�O@�&@�A��
�
�&�&�q�)=�'>���H�H�B�(�����$�$�Q�'A�%B���!1�!1�F3�&3�4��
�
�&�&�t�,�� � �"���� �� � �"��M�M�!�"r!)
r4r5r6r rSrqrsrwrzrIrJs@rrLrLms'���B��
�"�"�
#�#r!rLc�T�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
dd
�Zd�Zd�Z
d
�Zy	)�GtkInstallProgressAdapteri,c�^�tj|�d|_|j|_|j|_|j|_|j|_	|jjd|j�||_tjjdd�y)N�child-exitedzDPkg::StopOnError�False)rr �_cacherrr�expander_terminal�expander�_term�termrR�child_exitedrr�config�setrs  rr z"GtkInstallProgressAdapter.__init__�s���� � ��&����"�/�/����0�0��
��0�0��
��L�L��	��	�	���.�$�*;�*;�<����	�����.�w�7r!c�L�tj|�d|_|jj	td��|jjd�|jj	d�|jjd�|jj�|jjd|j�tjj!d�xsd}|dk(rP|j"rDd	|j"vs|j"d	j$sd
}|jj'd�d|j(zdg|_dtjvr|j*j-d
|z�d|_d|_d|_y)NFzApplying changesr;rGTzcontents-changed�DEBIAN_FRONTEND�gnomezlibgtk3-perlrozVTE_PTY_KEEP_FD=%szAPT_LISTCHANGES_FRONTEND=nonezDEBIAN_FRONTEND=%s)r�start_update�finishedrr#r]rr$r��
set_sensitiver�rtrR�_on_term_content_changed�os�environrr��is_installed�set_expanded�writefd�env�append�
start_time�time_ui�
last_activity)r�frontends  rr�z&GtkInstallProgressAdapter.start_update�s=���$�$�T�*���
�	
���"�"�1�%7�#8�9��
�
�"�"�3�'��
�
���s�#��
�
�#�#�D�)��	�	�����	�	���,�d�.K�.K�L��*�*�.�.�!2�3�>�w���w��4�;�;�"�d�k�k�1��K�K��/�<�<�#���
�
�*�*�4�0�(�$�,�,�6�3�5����B�J�J�.��H�H�O�O�0�8�;�<������� ��r!c��tj|||�tjd|�d|�d��tjdd�|vry|j
jj|j
j�td�|z}td�|z}d	|�d
|��}|j
jj�|j
jjd�|j
jj�jtjj �|j
j"j%|�|j
j&j)�j+|�|j
j,j/�|j
jj1�|j
jj3�y)Nz!got an error from dpkg for pkg: 'z': '�'�dpkgz*dependency problems - leaving unconfiguredFzCould not install '%s'zThe upgrade will continue but the '%s' package may not be in a working state. Please consider submitting a bug report about it.�<big><b>�</b></big>

r.)r�errorrUr�dgettextr�dialog_error�set_transient_forr_r]�realizerh�
get_window�
set_functionsr�
WMFunction�MOVE�label_errorrf�textview_error�
get_bufferr#�scroll_errorrtrgrv)r�pkg�errormsg�summaryrn�markups      rr�zGtkInstallProgressAdapter.error�sj�����d�C��2��
�
�c�8�T�U����F�$P�Q�U]�]��	
��� � �2�2�4�;�;�3J�3J�K��,�-��3���'�(�*-�.��07��<����� � �(�(�*���� � �*�*�2�.���� � �+�+�-�;�;�C�N�N�<O�<O�P������*�*�6�2����"�"�-�-�/�8�8��B���� � �%�%�'���� � �$�$�&���� � �%�%�'r!c�j�tjd|z�tj�}td�|z}td�}d|�d|��}|jj
j
|�|jjjd�|jjj|jj�tjj|�s|dz}tjjd�r�dd	||g}tj|tj �
�j#�d}|j%dd
�}|jj&j)�j+|�n<|jj&j)�j+td��|jjj-�}	|jjj/�|xj0tj�|z
z
c_|	t2j4j6k(rd}
nd}
	|j8j;|
j=d��y#|j8j;|
d�YyxYw)Nz.got a conffile-prompt from dpkg for file: '%s'z/Replace the customized configuration file
'%s'?ztYou will lose any changes you have made to this configuration file if you choose to replace it with a newer version.z"<span weight="bold" size="larger">z </span> 

r.z
.dpkg-distz
/usr/bin/diffz-u)�stdoutrzUTF-8�replacez The 'diff' command was not foundzy
zn
zutf-8���)rUrV�timer]r�label_conffilerf�dialog_conffilerhr�r_r��path�exists�
subprocess�Popen�PIPE�communicater��textview_conffiler�r#rgrvr�rrj�YESr��
feed_child�encode)r�current�newrs�prim�secr��cmd�diffrp�responses           r�conffilez"GtkInstallProgressAdapter.conffile�s����
�
�F��P�Q��	�	����C�D�w�N���#�$��OS�TW�X�����"�"�-�-�f�5����#�#�-�-�b�1����#�#�5�5�d�k�k�6M�6M�N��w�w�~�~�g�&��l�*�G��7�7�>�>�/�*�"�D�'�3�7�C��#�#��J�O�O�-�-8�[�]�1�>�D��;�;�w�	�2�D��K�K�)�)�4�4�6�?�?��E��K�K�)�)�4�4�6�?�?��Bd�@e�f��k�k�)�)�-�-�/�����#�#�(�(�*�����	�	��e�+�+���#�"�"�&�&�&��H��H�	/��I�I� � �����!9�:��	/��I�I� � ��2�.�s�'*J�J2c���tjjtjj�}tj�}|dk(r]|jD])}|jd�\}}|t
j|<�+|j�dt
jd<|S|jj|�|jj|�|S)Nr�=�1�DPKG_UNTRANSLATED_MESSAGES)r�Pty�new_sync�PtyFlags�DEFAULTr��forkr��splitr��child_setupr��set_pty�watch_child)r�pty�pidr��keyr%s      rr�zGtkInstallProgressAdapter.forks����g�g���s�|�|�3�3�4���g�g�i���!�8��x�x�
(��"�y�y��~���e�"'��
�
�3��
(�
�O�O��8;�B�J�J�3�4��
�
�I�I���c�"��I�I�!�!�#�&��
r!c�D�tj�|_d|_y)z� helper function that is called when the terminal changed
            to ensure that we have a accurate idea when something hangs
        FN)r�r��activity_timeout_reported)rr�s  rr�z2GtkInstallProgressAdapter._on_term_content_changed.s��"�Y�Y�[���).��&r!c�P�|jdk(rtj�|_t||jj	�dzz
�dkDrP|jjt
|�dz�|jj|j��|dkDr�|j|jz
}||jz}t
|�|z}d|z
|z}|dkDr6|dkr1|jjtd�t|�z�n|jjd�|jjrR|jjj!d	�d
k(r)|jjj#d|z�yyyy)Nr;r?r@��?g�N@i�ryrGzload-status�zprogress("%s"))r�r�rCrr{r$r&rr#�stripr�r�r]r
r�_webkit_view�get_property�execute_script)rr�rBr�delta�time_per_percentr�s       r�
status_changez'GtkInstallProgressAdapter.status_change5sV���?�?�c�!�"�i�i�k�D�O��w�t�}�}�1�1�3�E�9�9�:�S�@��M�M�&�&�u�W�~�e�';�<����&�&�v�|�|�~�6��S�=��&�&����8�E��T�\�\�!�E� %�e��W� 4���7�?�&6�6�C��T�z�c�Z�0��
�
�&�&�q�)=�'>��PS�AT�'T�U��
�
�&�&�s�+����(�(����(�(�5�5�m�D��I����(�(�7�7�8H�7�8R�S�J�)�r!Nc�^�|�|j�|_d|_y||_d|_y�NT)�get_child_exit_status�
apt_statusr�)rr�rs   rr�z&GtkInstallProgressAdapter.child_exitedOs0���>�"�8�8�:�D�O���
� &�D�O���
r!c�l�|js|j�|js�|jSr)r��update_interfacer�r0s r�
wait_childz$GtkInstallProgressAdapter.wait_childXs(���-�-��!�!�#��-�-����r!c�:�|jjd�y)Nr.�rr#r0s r�
finish_updatez'GtkInstallProgressAdapter.finish_update]s�����"�"�2�&r!c��tj|�|jdk(r/|jj	�tjd�|jdkDr�|j|jztj
�krv|jsEtjd|j�d|jj��d��d|_	|jjj!d�t#j$�r)t#j&�t#j$�r�)tjd�y)	Nr;g�������?rzno activity on terminal for z
 seconds (�)Tg{�G�z�?)rr�r�rrzr��sleepr��TIMEOUT_TERMINAL_ACTIVITYr�rU�warningr�get_textrr�r�rr(r)r0s rr�z*GtkInstallProgressAdapter.update_interface`s���(�(��.��?�?�c�!��M�M���!��J�J�s�O�����!�����!?�!?�?�4�9�9�;�N��1�1����QU�Qo�Qo�qu�rC�rC�rL�rL�rN�!O�P�15��.��K�K�)�)�6�6�t�<�� � �"���� �� � �"��
�
�4�r!r)r4r5r6rr r�r�r�r�r�r�r�r�r�r�r/r!rr�r��sC��!$��8�!�8(�.%/�N�$/�T�4��
'�r!r�c��eZdZd�Zdd�Zy)�DistUpgradeVteTerminalc� �||_||_yr)r�r)rrr�s   rr zDistUpgradeVteTerminal.__init__ts����	���r!c
�*��tr�fd�}n�fd�}�jj��jjd|��jj
j
d�|dk(r%�jj
jd�d�_tr>�jjtjjd|ddddd�\}}n<�jjtjjd|dddd�\}}|r|dkry�js_tj�r)tj �tj�r�)t#j$d��js�_�`y)	Nc���d�_yr��r�)�terminalrrs  �r�wait_for_childz3DistUpgradeVteTerminal.call.<locals>.wait_for_childy�
���"��
r!c���d�_yr�r)rWrs �rr
z3DistUpgradeVteTerminal.call.<locals>.wait_for_child}rr!r�TF�/rr@)�vte291r�rtrRrr�r�r�r��
spawn_syncrr�r��fork_command_fullrr(r)r�r�)rr��hiddenr
�successr�s`     r�callzDistUpgradeVteTerminal.callws>����
#�
#�	
�	�	�����	�	���.�.�9����%�%�3�3�D�9��5�=��K�K�)�)�6�6�t�<���
��!�Y�Y�1�1����$�$��������	�N�W�c�"�Y�Y�8�8����$�$��������N�W�c��#��'���-�-��$�$�&��"�"�$��$�$�&��J�J�s�O��-�-�
�Mr!N�F)r4r5r6r rr/r!rrrss���+r!rc�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�HtmlViewc��||_yr)r�)r�webkit_views  rr zHtmlView.__init__�s
��'��r!c�V�|jsy	ddlm}|sJ�|jj|�|jj	d|j
�y#t$rD|jj|�|jj	d|j�YywxYw)Nr��WebKit2zload-changedz
load-finished)	r��
gi.repositoryr�load_urirR�_on_load_changed�ImportError�open�_on_load_finished)r�urlrs   rr z
HtmlView.open�s���� � ��	O�-��N�7����&�&�s�+����%�%�n�d�6K�6K�L���	O����"�"�3�'����%�%�o�t�7M�7M�N�	O�s�AA�A
B(�'B(c�8�|jj�yr)r�rtr0s rrtz
HtmlView.show��������� r!c�8�|jj�yr)r�rvr0s rrvz
HtmlView.hide�r$r!c�$�|j�yr)rt)r�view�frames   rr!zHtmlView._on_load_finished�s���	�	�r!c�d�ddlm}||jjk(r|j	�yy)Nrr)rr�	LoadEvent�
LOAD_FINISHEDrt)rr'�event�datars     rrzHtmlView._on_load_changed�s'��)��G�%�%�3�3�3��I�I�K�4r!N)	r4r5r6r r rtrvr!rr/r!rrr�s!��(�
O�!�!��r!rc���eZdZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Z�fd�Zdd�Zdd�Z	dd�Zdd�Zdd�Zd�Zd�Zdd�Zd�Z�xZS) �DistUpgradeViewGtk3z& gtk frontend of the distUpgrade tool c�:	��tj��|�_|r|dk(ritjjtj�d�}tj�}ttj���_n2d}tjj|d�}t|��_tjtj�t�jd�	tj d|�t#j$d�t-j�|dzd�tj.j1�}	�j2j5|j7d	d
d���jj?d
d�}tAjB�jE|�}�jFjI�}	|	jKd|�}	�jFjM|	��jO�d�_(tj.j1��_)d�_*�j2jW��j2jY�j[t\j^j`�tc�jd��_3ti���_5tm���_7tq���_9tjtt8jv��_<tjzd�}
tj|�}|
j|d�|
j�|dd��j�j�|
��jxj�dtj�j���j�j��jx��j�j�d��fd�}�j�j�d|��j�t_Ly#t&$r#}t)j*d|z�Yd}~��4d}~wwxYw#t8j:$r#}t)j<d|z�Yd}~��d}~wwxYw)N�.�moz/usr/share/locale/�
gtkbuilder�GTKzubuntu-release-upgraderzError setting locales (%s)z/DistUpgrade.uizsystem-software-update� rz)error setting default icon, ignoring (%s)�Sources�To�%sr.Tr�Fc�r���jj�}�jj|�yr)�expander_details�get_expanded�dialog_changes�
set_resizable)�w�expandedrs  �r�
_activatedz0DistUpgradeViewGtk3.__init__.<locals>._activateds-����,�,�9�9�;�H����-�-�(�l�;r!�activate)Mrr �logdirr�r��join�getcwdrr�r�
init_check�sys�argv�
get_telemetry�set_updater_typer��bindtextdomainr�
textdomain�	ExceptionrUrr�	IconTheme�get_defaultr_�set_default_icon�	load_iconr�GErrorrVr�distro_info�UbuntuDistroInfo�version�label_title�	get_labelr��	set_label�create_terminal�	prev_step�	iconthemer�r�r�r�rr�r�r9r�_opCacheProgressrL�_acquireProgressr�_cdromProgressr��_installProgress�	TreeStore�TYPE_STRING�details_list�TreeViewColumn�CellRendererText�
pack_start�
add_attribute�treeview_details�
append_column�set_sort_column_id�SortType�	ASCENDING�	set_modelr<r=r:rR�_handleException�
excepthook)
r�datadirrB�	localedir�gladedir�e�icons�to_dist�
to_version�title_string�column�renderr@s
`            rr zDistUpgradeViewGtk3.__init__�sf���� � ��&�����'�S�.��g�g�l�l�2�9�9�;�t�4�I��Y�Y�[�H�+�B�I�I�K�8�D�K�*�I��W�W�\�\�'�<�8�H�+�G�4�D�K�	���s�x�x� ���(�(��/�	>��!�!�";�I�F����8�9�	�$�$�T�%-�.?�%?�%>�	@��
�
�)�)�+��	����-�-�e�o�o�>V�XZ�\]�.^�_�
�+�+�/�/�)�T�2�� �1�1�3�;�;�G�D�
��'�'�1�1�3��#�+�+�D�*�=�����"�"�<�0�	
����������2�2�4��� ������ � �"����#�#�%�3�3�C�N�N�4G�4G�H� -�d�.D�.D� E��� 9�$� ?���5�d�;��� 9�$� ?����M�M�'�*=�*=�>����#�#�B�'���%�%�'�����&�$�'����V�X�q�1����+�+�F�3����,�,�Q����0F�0F�G����'�'��(9�(9�:����)�)�%�0�	<�	
���%�%�j�*�=��.�.����w�	>��O�O�8�1�<�=�=��	>���~�~�	��M�M�E��I�J���	�s0�=+P5�!,Q$�5	Q!�>Q�Q!�$R�7R�Rc�@�ddl}|j|||�}tjddj	|�z�t|||�t
�s4|jtd�td�dj	|��tjd�y)Nrznot handled exception:
%s�
zA fatal error occurredz�Please report this as a bug (if you haven't already) and include the files /var/log/dist-upgrade/main.log and /var/log/dist-upgrade/apt.log in your report. The upgrade has aborted.
Your original sources.list was saved in /etc/apt/sources.list.distUpgrade.r	)
�	traceback�format_exceptionrUr�rCrr
r]rF�exit)rr[r%�tbrz�liness      rrlz$DistUpgradeViewGtk3._handleExceptions���
	��*�*�4���;���
�
�2�T�Y�Y�u�5E�E�F�	�T�5�"�%��|��J�J�q�1�2��>�?��y�y��'�
)�	����r!c�.�t||j�Sr)rr�r0s r�getTerminalzDistUpgradeViewGtk3.getTerminal(s��%�d�D�J�J�7�7r!c��|j�q		ddlm}|j�|_|jj
�}|jdd�|jj|jddd�t|j�S#t$r	ddlm}Y��wxYw#tjd�tj�cYSxYw)Nrr)�WebKitzenable-pluginsFTzhtml widget)r�rrrr��WebView�get_settings�set_property�	vbox_main�pack_endrU�	exceptionr�SampleHtmlViewr)rr��settingss   r�getHtmlViewzDistUpgradeViewGtk3.getHtmlView*s������$�
8�5�?�%+�N�N�$4��!��,�,�9�9�;���%�%�&6��>����'�'��(9�(9�4��q�I���)�)�*�*��#�5�4�5��
8��!�!�-�0�&�5�5�7�7�s)�B�A)B(�B%�"B(�$B%�%B(�(+Cc���t|j�dk(rYt|j�dk(rAtd�}td�}|j	||�}tjd|�|Sy)Nr	�zCtrl-c pressedzkThis will abort the operation and may leave the system in a broken state. Are you sure you want to do that?z5ctrl-c press detected, user decided to pass it on: %sF)�len�string�ordr]�askYesNoQuestionrUr)rrW�keyevr�rnrps      r�_key_press_handlerz&DistUpgradeViewGtk3._key_press_handler:so���u�|�|���!�c�%�,�,�&7�1�&<��(�)�G��K�L�C��'�'���5�C��O�O�%�&)�
+��7�N�r!c��tjj�|_t	|jd�s%|jj
|j_|jjd|j�tjd�}|jj|�g|_|jj|jddd�|jj�t!j"�|_|j$j'�|jj|j$ddd�|j$j)|jj+��	t-t.j0j3|j4d�d�|_|jS#t8$r#t:j<|_Y|jSwxYw)z! helper to create a vte terminal r�zkey-press-eventzmonospace 10Trzterm.logr>)r�Terminalr�r��hasattr�set_pty_objectr�rRr�r�font_description_from_string�set_font�_terminal_lines�hbox_customrdr�r�
VScrollbar�vscrollbar_terminalrt�set_adjustment�get_vadjustmentr r�r�rCrB�
_terminal_logrLrFr�)r�fontdescs  rrXz#DistUpgradeViewGtk3.create_terminalFsi���\�\�%�%�'��
��t�z�z�9�-�!%���!:�!:�D�J�J���
�
���,�d�.E�.E�F��5�5�n�E���
�
���H�%�!������#�#�D�J�J��d�A�>��
�
����#&�>�>�#3�� �� � �%�%�'����#�#�D�$<�$<�d�D�!�L�� � �/�/��
�
�0J�0J�0L�M�	,�!%�b�g�g�l�l�4�;�;�z�&J�3�!O�D���z�z����	,�!$���D���z�z��	,�s�
9G�G>�=G>c��|jSr)r\r0s r�getAcquireProgressz&DistUpgradeViewGtk3.getAcquireProgress_����$�$�$r!c�<�||j_|jSr)r^r�)r�caches  r�getInstallProgressz&DistUpgradeViewGtk3.getInstallProgressas��',����$��$�$�$r!c��|jSr)r[r0s r�getOpCacheProgressz&DistUpgradeViewGtk3.getOpCacheProgressdr�r!c��|jSr)r]r0s r�getCdromProgressz$DistUpgradeViewGtk3.getCdromProgressfs���"�"�"r!c�@�|jjd|z�y)Nr8r�)rrns  r�updateStatusz DistUpgradeViewGtk3.updateStatushs�����"�"�4�#�:�.r!c��t|d|jz�}t|d|jz�}|j�|j�y�N�image_step%i�label_step%i)�getattrr%rv�rr+�image�labels    r�hideStepzDistUpgradeViewGtk3.hideStepjs>����^�d�j�j�8�9����^�d�j�j�8�9��
�
�
��
�
�
�r!c��t|d|jz�}t|d|jz�}|j�|j�yr�)r�r%rtr�s    r�showStepzDistUpgradeViewGtk3.showStepps>����^�d�j�j�8�9����^�d�j�j�8�9��
�
�
��
�
�
�r!c�:�tjj}|j}|rst	|d|j
z�}t	|d|j
z�}|j
tj|�|j�|j�yy)Nr��arrow_step%i)
r�IconSize�MENUrYr�r%�set_from_stock�STOCK_CANCELrtrv)r�sizer+r��arrows     r�abortzDistUpgradeViewGtk3.abortust���|�|� � ���~�~����D��$�*�*�!<�=�E��D��$�*�*�!<�=�E�� � ��!1�!1�4�8��J�J�L��J�J�L�r!c�|��tt|�|�|jj	�rtjd�tjj}tj�}|jr�t|d|jjz�}t|d|jjz�}t|d|jjz�}|jd|�|j!tj"|�|j%�|j'�||_t|d|jz�}t|d|jz�}t|d|jz�}|j)d�sy|j%�|j'�y)Nzicon theme changed, re-readingr�r�r��
attributes�visible)rAr/�setSteprZ�rescan_if_neededrUrVrr�r�r�AttrListrYr�r%r�r��STOCK_APPLYrtrvr�)rr+r��attrlistr�r�r�rEs       �rr�zDistUpgradeViewGtk3.setStep~sB���
�!�4�0��6��>�>�*�*�,��M�M�:�;��|�|� � �����!���>�>��D��$�.�.�2F�2F�!F�G�E��D��$�.�.�2F�2F�!F�G�E��D��$�.�.�2F�2F�!F�G�E����|�H�5�� � ����$�7��J�J�L��J�J�L������^�d�j�j�8�9����^�d�j�j�8�9����^�d�j�j�8�9���!�!�)�,��
�
�
��
�
�
�r!c�.�|jjd�|jj|j�d|�d|��}|jj|�|dk7rF|jj�}|j|�|jj�n|jj�|jj�|jj�jtj j"�|jj%�|jj�t'j(�r*t'j*�t'j(�r�)yy)Nr.r�r�)�dialog_informationrhr�r_�label_informationrf�textview_informationr�r#�scroll_informationrtrvr�r�r�rr�r�rgrr(r)�rr�rn�extended_msg�buffers     r�informationzDistUpgradeViewGtk3.information�s�����)�)�"�-����1�1�$�2B�2B�C�.5�c�:�����)�)�#�.��4���.�.�9�9�;�F��O�O�L�)��#�#�(�(�*��#�#�(�(�*����'�'�)����*�*�,�:�:�3�>�>�;N�;N�O����#�#�%����$�$�&�� � �"���� �� � �"r!c��|jjd�|jj|j�d|�d|��}|jj|�|dk7rF|jj�}|j|�|jj�n|jj�|jj�|jj�jtj j"�|jj%�|jj�y)Nr.r�r�F)r�rhr�r_r�rfr�r�r#r�rtrvr�r�r�rr�r�rgr�s     rr�zDistUpgradeViewGtk3.error�s������#�#�B�'����+�+�D�,<�,<�=�,3�S�9�����#�#�C�(��4���(�(�3�3�5�F��O�O�L�)����"�"�$����"�"�$����!�!�#����$�$�&�4�4�S�^�^�5H�5H�I������������ �r!c�^�tj|||||�sy|xjdtd�zz
c_|dk7rr|jjd�|jj
d�|jj|d�|jj|d�|jjd|z�|jj|j�|jj�td�|jftd	�|jftd
�|j ftd�|j"ftd�|j$ftd
�|j&ffD]�\}}|s�	|jj)d|t+|�zg�}	|D]W}
|jj)|	d|
j,�dt/j0t3|
j4dd����g��Y��|j6j9�|j6j;|j<�|j6j?d�|j6jA�jCtDjFjHtDjFjJz�|j6jM�}|j6jO�|tPjRjTk(ryy)NFz

<b>%s</b>z?To prevent data loss close all open applications and documents.Trr	z<big><b>%s</b></big>z%No longer supported by Canonical (%s)z<b>Downgrade (%s)</b>zRemove (%s)zNo longer needed (%s)zInstall (%s)zUpgrade (%s)z<b>z</b> - r�r.)+r�confirmChanges�confirmChangesMessager]�button_cancel_changes�
set_use_stock�set_use_underlinerW�button_confirm_changes�
label_summaryrf�
label_changesra�clear�	demotions�toDowngrade�toRemove�toRemoveAuto�	toInstall�	toUpgrader�r��namer�markup_escape_textr��	candidater<r�r�r_rhr�r�rr�r��RESIZErgrvrrjr�)rr��changesr��downloadSize�actions�removal_bold�parent_textra�noder�rps            rr�z"DistUpgradeViewGtk3.confirmChanges�s����-�-�d�G�W�.7��G���"�"��
�,�
-�(-�	-�"��d�?��&�&�4�4�U�;��&�&�8�8��>��&�&�0�0����<��'�'�1�1�'�!�*�=����%�%�&<�w�&F�G����%�%�d�&@�&@�A������!��7�8�$�.�.�I��'�(�$�*:�*:�;��
���
�
�.��'�(�$�*;�*;�<�������0�������0�
,�
	h�'�[�,���(�(�/�/��1<�s�<�?P�1P�0Q�S��'�h�C��%�%�,�,�T��(�(�D�$;�$;�G�C�M�M�S\�^b�<c�$d�5f�4g�h�h�
	h�	
���#�#�%����-�-�d�.>�.>�?����%�%�b�)����&�&�(�6�6�s�~�~�7J�7J�14���1F�1F�8G�	H��!�!�%�%�'����� � �"��#�"�"�&�&�&��r!c�Z�d|�d|��}tj|jtjjtj
jtjj��}|jd�|dk(r*|jtjj�n)|jtjj�|j|�|j�}|j!�|tjjk(ryy)Nr�r�rYr.�NoTF)rr^r_r`rarbrcrd�YES_NOrh�set_default_responserj�NOr�rfrgri�rr�rn�defaultrorps      rr�z$DistUpgradeViewGtk3.askYesNoQuestion�s���.5�c�:���"�"�$�*:�*:�),���)>�)>�(+���(@�(@�+.�?�?�+A�+A�C��	������d�?��'�'��(8�(8�(;�(;�<��'�'��(8�(8�(<�(<�=����#���j�j�l�������#�"�"�&�&�&��r!c�
�|rd|�d|��}tj|jtjjtj
jtjj��}|jd�|j|�|jtd�tjjtd�tjj�|dk(r*|j!tjj�n)|j!tjj�|j#�}|j%�|tjjk(ryy)	Nr�r�rYr.�Cancel�ContinueTF)rr^r_r`rarb�WARNINGrd�NONErhrf�add_buttonsr]rj�CANCEL�ACCEPTr�rgrir�s      r�askCancelContinueQuestionz-DistUpgradeViewGtk3.askCancelContinueQuestions���29�#�>�C��"�"�$�*:�*:�),���)>�)>�(+���(?�(?�+.�?�?�+?�+?�A��	��������#�����1�X�;��(8�(8�(?�(?��Z�=�#�*:�*:�*A�*A�	C��h���'�'��(8�(8�(?�(?�@��'�'��(8�(8�(?�(?�@��j�j�l�������#�"�"�)�)�)��r!c���|jj|j�|jjd�|jj	�|jj�j
tjj�|jj�}|jj�|tjjk(ryy)Nr.TF)�dialog_restartr�r_rhr�r�r�rr�r�rgrvrrjr�)rrps  r�confirmRestartz"DistUpgradeViewGtk3.confirmRestarts������-�-�d�.>�.>�?����%�%�b�)����#�#�%����&�&�(�6�6�s�~�~�7J�7J�K��!�!�%�%�'����� � �"��#�"�"�&�&�&��r!c��tj�r*tj�tj�r�)yyr)rr(r)r0s r�
processEventsz!DistUpgradeViewGtk3.processEvents%s(��� � �"���� �� � �"r!c�t�|jj�|r|jjd�yy)Nr�)rrzr$)rr�s  r�
pulseProgressz!DistUpgradeViewGtk3.pulseProgress)s0�����$�$�&���"�"�/�/��4�r!c��|jj|j�|jjd�|jj	�|jj�j
tjj�|jj�}|jj�|tjjk(rtj d�y)Nr.r	T)�
dialog_cancelr�r_rhr�r�r�rr�r�rgrvrrjr�rFr|)rrWr,rps    r�on_window_main_delete_eventz/DistUpgradeViewGtk3.on_window_main_delete_event.s������,�,�T�-=�-=�>����$�$�R�(����"�"�$����%�%�'�5�5�c�n�n�6I�6I�J�� � �$�$�&�������!��#�"�"�)�)�)��H�H�Q�K�r!)NNrr�)r�)r�r)r4r5r6r7r rlr�r�r�rXr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrIrJs@rr/r/�s����,�O/�b�,8�+� 
��2%�%�%�#�/���
��<!�$�&37�.�`�$�0	�!�5�
	r!r/�__main__)z
/usr/bin/dpkgz--configurez-a�TODOzTODO~�short�longa�asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended
asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended
asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended
asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended
asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended
asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended
asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended
�xx�d)G�gir�require_versionrrrLr�r�r�rrrrrrFr�rUr�r��aptrrRr��DistUpgradeApportr
rrr
rr�DistUpgradeConfigParserr�	telemetryrrH�SimpleGtk3builderApprr�DistUpgradeGettextr]r�base�
CdromProgressr�
OpProgressr9rLr��objectrrr/r4r'�fp�ipr�r�mainr|�Cacher�rGr�r��mark_delete�mark_install�commitr�r�r�r/r!r�<module>r!sL��,
�	��	#��B���u�f�%�!�
�F����!��
�
����
���	�7�^�^�6�+�5��,��c�l�l�/�/�=�=��*'�C�L�L�%�%�0�0�'�0@#��@#�F@��@�F/�V�/�d�v��4x�/�*=�x�v�z��� �D�	"�4�	(�B�	"�4�	(�B�������@�A��C�H�H�J��C�H�H�Q�K��C�I�I�K�E��x�x���|�&����:�"�"��#�J�"�"�$��#�J�#�#�%�	&�

�L�L��B���C�H�H�J��K�K��w��������@�A��J�J�w�v�Q��	����R��%�A��{�#��B���u�f�%�"��w�w�{�{�C�G�G��#�s�I�AJ �J 

Zerion Mini Shell 1.0