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

�

4��e¤��b�	ddlmZe�dk(re�ddlmZddlmZmZmZm	Z	m
Z
ddlmZm
Z
mZmZmZmZmZmZmZmZddlmZmZmZmZdd	lZdd	lZdd	l Z dd	l!Z!dd	l"Z"dd	l#Z#dd	l$Z$dd	l%Z%dd	l&Z&dd	l'Z'dd	l(Z(dd	l)Z)dd
l*m+Z+m,Z,ddl-m-Z-m.Z.m/Z/m0Z0ddl1m2Z2dd
l3m4Z5dd	l6Z6dd	l7Z7ddl8m7Z9ddl8m:Z:ddl;m;Z;d1d�Z<d�Z=d�Z>gfd�Z?d�Z@ej�e_Ae@e_@Gd�d�ZBGd�de�ZCGd�de$j�j�j��ZGGd�de$j�j�j��ZIGd�de0�ZJGd �d!e/�ZKGd"�d#e�ZLGd$�d%e-�ZMeNd&k(�r�eM�ZOeOj�d'd(�ej�dd)k(r�eOj�j��ZTeTdk(r$e"j�d*g�ej��	eOj�j��e
j��e!j�d,��>ej�dd-k(r�eZej�d.�5Z[e[j��Z]d	d	d	�e]D]@Z^eOj�j�e^�e
j��e!j�d/��B	e
j���e$j��Zaej�dd	D]IZbeaebj�r%eaebj�seaebj�d+�0��7eaebj���Keaj�eOj�eOj��	e
j���y	#e$r8ddlmZddlmZmZmZm	Z	m
Z
ddlmZmZmZm
Z
mZmZmZmZmZmZmZmZmZmZY��TwxYw#1swY��HxYw)2�)�get_dist�trusty�)�uic)�Qt�QLocale�QTranslator�PYQT_VERSION�QTimer)
�	QTextEdit�QApplication�QDialog�QMessageBox�QDialogButtonBox�QTreeWidgetItem�QPushButton�QWidget�QHBoxLayout�QLabel)�QTextOption�QPixmap�QIcon�QTextCursor)rrrr
rrrrrrrrrrN)�
run_apport�apport_crash)�DistUpgradeView�FuzzyTimeToStr�InstallProgress�AcquireProgress)�DistUpgradeConfig)�get)�gettext)�unicode_gettext)�
QUrlOpenerc�J�t|t�r|jd|�S|S)N�UTF-8)�
isinstance�bytes�decode)�s�errorss  �@/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeViewKDE.py�utf8r-Ms"���!�U���x�x���(�(���c��tjj|�rtj||�ytd|z�y)Nzerror, can't find file: )�os�path�existsr�loadUi�print)�file�parents  r,r3r3Ts0��	�w�w�~�~�d���
�
�4�� �	�(�4�/�0r.c�X�tjj|�rt|�Sy�N)r0r1r2r)r1s r,�_find_pixmapr9[s��	�w�w�~�~�d���t�}��r.c��tt�tk(rtj|�S|D]}t|�}|s�t|�cSyr8)�typer
�intr�	fromThemer9)�name�	fallbacksr1�pixmaps    r,�_iconrA`sI���L��S� ����t�$�$��	%�D�!�$�'�F���V�}�$�	%�r.c�H�|j�s|j|�yyr8)�isMaximized�origAdjustSize��selfs r,�
adjustSizerGqs!���������D�!�r.c�4�eZdZdZdZdd�Zd�Zd�Zd�Zd�Z	y)	�
_OSReleasez/etc/os-releasec���i|_d|_tj|_t
jj|j�sy|j�d|_|r|j�yy)NFT)
�result�validrI�OS_RELEASE_FILEr5r0r1�isfile�parse�inject_lsb_compat)rF�
lsb_compats  r,�__init__z_OSRelease.__init__{sX�������
��.�.��	��w�w�~�~�d�i�i�(���
�
����
���"�"�$�r.c��|jd|jd<|jd|jd<|jjd�|jd<|jds(|jjd�|jd<|jjd�|jd	<y)
N�IDzDistributor ID�PRETTY_NAME�Description�VERSION_CODENAME�Codename�UBUNTU_CODENAME�
VERSION_ID�Release)rKr!rEs r,rPz_OSRelease.inject_lsb_compat�s���(,���D�(9����$�%�%)�[�[��%?����M�"�"&�+�+�/�/�2D�"E����J���{�{�:�&�&*�k�k�o�o�6G�&H�D�K�K�
�#�!%������!>����I�r.c���t|jd�}|D]4}|j�}|s�|j|j	dd���6|j�y)N�r�=r)�openr5�strip�parse_entry�split�close)rF�f�lines   r,rOz_OSRelease.parse�sX������C� ���	2�D��:�:�<�D����D���d�j�j��a�0�1�		2�
	
���	r.c��|j|�}|dk(r!t|t�r|jd�}||j|<y)N�ID_LIKE� )�parse_valuer'�strrbrK)rF�key�values   r,raz_OSRelease.parse_entry�sA��� � ��'���)��
�5�#� 6��K�K��$�E� ����C�r.c�V�tj|�}t|�dk(r|dS|S)Nrr)�shlexrb�len)rFrl�valuess   r,riz_OSRelease.parse_value�s+�����U�#���v�;�!���!�9���
r.N)T)
�__name__�
__module__�__qualname__�DEFAULT_OS_RELEASE_FILErMrRrPrOrari�r.r,rIrIws&��/��'�O�%�?��!�r.rIc�4�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	y)	�DumbTerminalz A very dumb terminal c��tj|d|�||_|jd�|j	d�|jtj�|jd�|jd�d|_
y)z2 really dumb terminal with simple editing support ��	Monospace�FTN)rrR�installProgress�
setFontFamily�setFontPointSize�setWordWrapModer�NoWrap�setUndoRedoEnabled�setOverwriteMode�_block)rFr|�parent_frames   r,rRzDumbTerminal.__init__�so�����4��\�2�.������;�'����a� ����[�/�/�0�����&����d�#���r.c��tj�\|_|j_|jdk(rdt
jd<|jS)�
pty voodoor�dumb�TERM)�pty�fork�	child_pidr|�	master_fdr0�environrEs r,r�zDumbTerminal.fork�sA��;>�8�8�:�8����-�-�7��>�>�Q��!'�B�J�J�v���~�~�r.c�2�tj|jjgggd�\}}}t|�dkDrDt	j
|jjd�}|j
t|��tj�y)Nr�)
�selectr|r�ror0�read�insertWithTermCodesr-r
�
processEvents)rF�rlist�wlist�xlistres     r,�update_interfacezDumbTerminal.update_interface�ss�� &�
�
�t�/C�/C�/M�/M�.N�r�RT�VW� X����u��u�:��>��7�7�4�/�/�9�9�3�?�D��$�$�T�$�Z�0��"�"�$r.c��d}|D]e}t|�dk(r2|j|�|j�j�d}�C|t	d�k(r�R|t	d�k(r�a||z
}�g|j|�y)z support basic terminal codes ryr{�
�N)�ord�insertPlainText�
textCursor�deletePreviousChar�chr)rF�text�display_text�cs    r,r�z DumbTerminal.insertWithTermCodes�s}�����
	"�A��1�v��{��$�$�\�2����!�4�4�6����c�"�g����c�!�f�����!��
	"�	
���\�*r.c��t|jd�sy|j�tjk(r4tj|jjtd��y|j�sytj|jj|j�jd��y)z$ send (ascii) key events to the pty r�Nr{zutf-8)�hasattrr|rkr�
Key_Backspacer0�writer�r�r��encode)rF�evs  r,�
keyPressEventzDumbTerminal.keyPressEvent�s����t�+�+�[�9��
�6�6�8�r�'�'�'��H�H�T�)�)�3�3�S��V�<���w�w�y��
����%�%�/�/�����1A�1A�'�1J�Kr.c�x�|jryd|_|jtj�d|_y)z: helper that ensures that the cursor is always at the end NTF)r��
moveCursorr�EndrEs r,�onCursorPositionChangedz$DumbTerminal.onCursorPositionChanged�s*���;�;�����������(���r.N)
rqrrrs�__doc__rRr�r�r�r�r�rur.r,rwrw�s$�� �
��%�+�&L� r.rwc�(�eZdZdZd�Zd�Zd�Zd�Zy)�KDECdromProgressAdapterz Report the cdrom add progress c�~�|jj|_|jj|_||_yr8)�window_main�label_status�status�progressbar_cache�progressbarr6�rFr6s  r,rRz KDECdromProgressAdapter.__init__�s0���(�(�5�5���!�-�-�?�?�����r.c���|r|jj|�|jjt	|j
t
|j�z��tj�y)z; update is called regularly so that the gui can be redrawn N)
r��setTextr��setValuer<rl�float�
totalStepsr
r�)rFr��steps   r,�updatezKDECdromProgressAdapter.update�sN���
�+�+�
�
�d�
#����!�!�#�d�j�j��t���1G�&G�"H�I��"�"�$r.c��y)N)FryrurEs r,�ask_cdrom_namez&KDECdromProgressAdapter.ask_cdrom_names��r.c��y)NFrurEs r,�change_cdromz$KDECdromProgressAdapter.change_cdroms��r.N)rqrrrsr�rRr�r�r�rur.r,r�r��s��)��
%��r.r�c�0��eZdZdZd�Zd�fd�	Zd�Z�xZS)�
KDEOpProgressz methods on the progress bar c� �||_||_yr8)r��progressbar_label)rFr�r�s   r,rRzKDEOpProgress.__init__
s��$�d��0�d�r.c���tt|�|�|jj	t|j��tj�yr8)	�superr�r�r�r�r<�percentr
r�)rFr��	__class__s  �r,r�zKDEOpProgress.updates=����M�4�'��0�������D�L�L� 1�2�� � �"r.c�:�|jjd�y�Nry)r�r�rEs r,�donezKDEOpProgress.dones��
���$�$�R�(r.r8)rqrrrsr�rRr�r��
__classcell__�r�s@r,r�r�s���%�1�#�)r.r�c�.�eZdZdZd�Zd�Zd�Zd�Zd�Zy)�KDEAcquireProgressAdapterz? methods for updating the progress bar while fetching packages c��tj|�|jj|_|jj
|_||_yr8)rrRr�r�r�r��progressr6r�s  r,rRz"KDEAcquireProgressAdapter.__init__&s=��� � ��&��(�(�5�5����*�*�<�<��
���r.c���td�||fz}tj|jjtd�|tj
tj�}|tj
k(ryy)Nz&Please insert '%s' into the drive '%s'zMedia ChangeTF)�_r�questionr6r��Ok�Cancel)rF�medium�drive�msg�changes     r,�media_changez&KDEAcquireProgressAdapter.media_change-s^��
�6�7�6�%�.�H�c��#�#�D�K�K�$;�$;�Q�~�=N�PS�U`�Uc�Uc�ep�ew�ew�x�f�	�;�>�>�	!��
r.c��tj|�|jjd�|jj�y)Nr)r�startr�r�r��showrEs r,r�zKDEAcquireProgressAdapter.start4s2�����d�#��
�
���q�!������r.c��|jjjjd�|jjtd��y)N�  zFetching is complete)r6r��
progress_textr�r�r�rEs r,�stopzKDEAcquireProgressAdapter.stop:s8�������-�-�5�5�d�;������A�4�5�6r.c��tj||�|jjt	|j
��|jdz}||jkDr|j}|jdkDr�tj|j�}t|t�r#|jtj��}|j j#t%d�||j|fz�|j&j(j*j#dt%d�t-|j.�zzdz�nb|j j#t%d�||jfz�|j&j(j*j#d�t1j2�y	)
z\ we don't have a mainloop in this application, we just call processEvents here and elsewhererrz!Fetching file %li of %li at %sB/sz<i>�About %s remainingz</i>zFetching file %li of %lir�T)r�pulser�r�r<r��
current_items�total_items�current_cps�apt_pkg�size_to_strr'r(r)�locale�getpreferredencodingr�r�r�r6r�r�r�etar
r�)rF�owner�current_itemr�s    r,r�zKDEAcquireProgressAdapter.pulse>sa��	���d�E�*��
�
���s�4�<�<�0�1��)�)�A�-���$�*�*�*��+�+�L����a��!�-�-�d�.>�.>�?�K��+�u�-�)�0�0��1L�1L�1N�O���K�K����"E� F�,�X\�Xh�Xh�ju�Iv� v�w��K�K�#�#�1�1�9�9�%�!�DX�BY�\j�ko�ks�ks�\t�Bt�:t�w}�:}�~��K�K����"<� =��t�O_�O_�@`� `�a��K�K�#�#�1�1�9�9�$�?��"�"�$�r.N)	rqrrrsr�rRr�r�r�r�rur.r,r�r�!s��I����7�r.r�c�P�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zy
)�KDEInstallProgressAdapterz?methods for updating the progress bar while installing packages��c�<�tj|�d|_|jj|_|jj
|_|jj|_||_	tdd�|_
t$j&j)dd�y#t$rj}tjd|z�tjdk\r tj j"|_
ntj |_
Yd}~��d}~wwxYw)Nz/var/log/dist-upgrade/term.log�wbzCan not open terminal log: '%s'�3zDPkg::StopOnError�False)rrR�_cacher�r�r�r�r�r6r_�
_terminal_log�	Exception�logging�error�sys�version�stdout�bufferr��config�set)rFr6�es   r,rRz"KDEInstallProgressAdapter.__init__\s���� � ��&����"�.�.�;�;����*�*�<�<��
�#�/�/�=�=������	0�!%�&F�t�!L�D��	�����.�w�7���	0��M�M�;�a�?�@��{�{�c�!�%(�Z�Z�%6�%6��"�%(�Z�Z��"���
	0�s�6B(�(	D�1A D�Dc�x�tj|�d|_|jj	td��|jjd�|jj	d�d|_	d|_
d|_|jjjjd�y)NFzApplying changesrrh�T)r�start_update�finishedr�r�r�r�r�r��
start_time�time_ui�
last_activityr6r��showTerminalButton�
setEnabledrEs r,rz&KDEInstallProgressAdapter.start_updateos����$�$�T�*���
�	
���!�!�!�$6�"7�8��
�
���q�!����"�"�3�'������� ��������2�2�=�=�d�Cr.c��tj|||�tjd|�d|�d��tjdd�|vrytd�|z}td�|z}d	|�d
|��}t
|jj�}td|�|jj|�|jj|�|dk7r6|jj|�|jj�n|jj�|j!�|j#�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><br />�dialog_error.ui)rr�r�r"�dgettextr�rr6r�r3�translate_widget_children�label_errorr��textview_errorr��hiderG�exec_)rF�pkg�errormsg�summaryr��dialogues      r,r�zKDEInstallProgressAdapter.error~s
�����d�C��2��
�
�c�8�T�U����F�$P�Q�U]�]���,�-��3���'�(�*-�.��18��=���4�;�;�2�2�3��� �(�+����-�-�h�7����$�$�S�)��t���#�#�+�+�H�5��#�#�(�(�*��#�#�(�(�*��������r.c��tjd|z�tj�}td�|z}td�}d|�d|��}t	|j
j�|_td|j�|jjj|�|jjj�|jjjj|j �t"j$j'|�s|dz}t"j$j'd�rtdd	||g}t)j*|t(j,�
�j/�d}|j1dd
�}|jjj|�n.|jjjtd��|jj3�}	|xj4tj�|z
z
c_|	tj6k(r!t#j8|j:d�yt#j8|j:d�y)z6ask question in case conffile has been changed by userz.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> 

zdialog_conffile.uiz
.dpkg-distz
/usr/bin/diffz-u)rrr&�replacez The 'diff' command was not foundsy
sn
N)r��debug�timer�rr6r��confDialoguer3�label_conffiler��textview_conffiler�show_difference_button�clicked�connect�showConffiler0r1r2�
subprocess�Popen�PIPE�communicater)rr
�Acceptedr�r�)
rF�current�newr��prim�sec�markup�cmd�diffrKs
          r,�conffilez"KDEInstallProgressAdapter.conffile�s����
�
�F��P�Q��	�	����C�D�w�N���#�$��OS�TW�X��#�D�K�K�$;�$;�<����#�T�%6�%6�7����(�(�0�0��8����+�+�0�0�2�	
���0�0�8�8�@�@��AR�AR�S��w�w�~�~�g�&��L�(�'��7�7�>�>�/�*� �$���5�#��!�!�#�j�o�o�>�J�J�L�Q�O�$����W�i�0�$�
�
�
�
-�
-�
5�
5�d�
;�
�
�
�
-�
-�
5�
5�a�8Z�6[�
\��"�"�(�(�*������	�	��e�+�+���W�%�%�%��H�H�T�^�^�V�,��H�H�T�^�^�V�,r.c��|jjj�rS|jjj�|jjjt
d��y|jjj�|jjjt
d��y)NzShow Difference >>>z<<< Hide Difference)r"r$�	isVisiblerr%r�r�r�rEs r,r(z&KDEInstallProgressAdapter.showConffile�s������.�.�8�8�:����/�/�4�4�6����4�4�<�<�Q�?T�=U�V����/�/�4�4�6����4�4�<�<�Q�?T�=U�Vr.c��tj�\|_|_|jdk(radtj
d<dtj
vstj
ddk(rdtj
d<dtj
d<t
jd	|jz�|jS)
r�rr�r��DEBIAN_FRONTEND�kde�noninteractive�none�APT_LISTCHANGES_FRONTENDz fork pid is: %s)r�r�r�r�r0r�r�r rEs r,r�zKDEInstallProgressAdapter.fork�s���+.�8�8�:�(������>�>�Q��!'�B�J�J�v��!����3��
�
�,�-��6�0@��
�
�,�-�5;�B�J�J�1�2��
�
�(�4�>�>�9�:��~�~�r.c��|jdk(rtj�|_|jjt	|j
��|jjt|j���|dkDr�tj�|_
d|_|j|jz
}||jz}t|�|z}d|j
z
|z}|dkDr6|dkr1|jjtd�t!|�z�y	|jjd�y	y	)
zupdate progress bar and labelrg�?FgY@g�N@i�r�rhN)r	r!r�r�r<r�r�r�r-r`r�activity_timeout_reportedr
r�r�r�r)rFrr�r��delta�time_per_percentr�s       r,�
status_changez'KDEInstallProgressAdapter.status_change�s���?�?�c�!� �I�I�K�$�/��
�
���s�4�<�<�0�1����!�!�$�v�|�|�~�"6�7��S�=�#�y�y�{�$�
�+0�$�
(��$�$�t���6�%�
�4�<�<�
�%�#�E�l�7�2�
�����%�)9�9�#�
�4�Z�C�:�.����&�&�q�)=�'>��PS�AT�'T�U����&�&�s�+�r.c�:�|jjd�yr�)r�r�rEs r,�
finish_updatez'KDEInstallProgressAdapter.finish_update�s�����!�!�"�%r.c��		tj|jgggd�\}}}t|�dkDrltj|jd�}|j
j
|�|jjjt|d���nn	��	tj |�|j&dkDr�|j&|j(zt+j*�kr�|j,sF	tj.d|j(�d
|j0j3��d
��d|_|jj6j8j;�t=j>�t+j@d�y#t$r.}t|�tjd|z�Yd}~��/d}~wwxYw#t"$r8}tj$d|j�d	|�d
��d|_Yd}~��]d}~wwxYw#t4$r&tj.d|j(z�Y��wxYw)z�
        no mainloop in this application, just call processEvents lots here
        it's also important to sleep for a minimum amount of time
        Trr�r)r+z&error reading from self.master_fd '%s'Nz@got ValueError from InstallProgress.update_interface. Line was 'z' (�)ryzno activity on terminal for z
 seconds (z&no activity on terminal for %s secondsg{�G�z�?)!r�r�ror0r�r�r�r6�
terminal_textr�r-r�r4r�r rr��
ValueErrorr�r�TIMEOUT_TERMINAL_ACTIVITYr!r?�warningr�r��UnicodeEncodeErrorr��
konsole_framer�r
r��sleep)rFr�r�r�rers      r,r�z*KDEInstallProgressAdapter.update_interface�s����
�(.�
�
�t�~�~�6F�r�"�a�(P�%���u��u�:��>��7�7�4�>�>�3�7�D��&�&�,�,�T�2��K�K�-�-�A�A��T�)�4�6��6�
� 	�
�
*�
*�4�
0�����!�����!?�!?�?�4�9�9�;�N��/�/�
m����QU�Qo�Qo�qu�rC�rC�rH�rH�rJ�!K�L�.2�D�*�
�+�+�
!�
!�
/�
/�
4�
4�
6��"�"�$��
�
�4���1�
��a���
�
�F��J�K���
���	�
�-�-�fj�fo�fo�qr�s�
t��$�)�)��	��&�
m���� H�D�Lj�Lj� k�l�
m�sB�B!F$�(G�>H"�$	G�-#G�G�	H�'-H�H�"+I�Ic��	|j�tj|jtj�\}}||jk(r	|S�Tr8)r�r0�waitpidr��WNOHANG)rF�pid�ress   r,�
wait_childz$KDEInstallProgressAdapter.wait_childsF����!�!�#����D�N�N�2�:�:�>�J�S�#��d�n�n�$���
�
r.N)rqrrrsr�rIrRrr�r5r(r�rBrDr�rSrur.r,r�r�VsC��I�!$��8�&
D��2#-�JW�
�,�.&�(�Tr.r�c��eZdZd�Zd�Zd�Zy)�UpgraderMainWindowc�F�tj|�td|�y)Nzwindow_main.ui)rrRr3rEs r,rRzUpgraderMainWindow.__init__"s����������&r.c��||_yr8)r6)rF�	parentRefs  r,�	setParentzUpgraderMainWindow.setParent's	����r.c�~�|jj�}|r|j�y|j�yr8)r6�on_window_main_delete_event�accept�ignore)rF�eventrcs   r,�
closeEventzUpgraderMainWindow.closeEvent*s)�����7�7�9����L�L�N��L�L�Nr.N)rqrrrsrRrYr_rur.r,rUrU s��'�
 �r.rUc���eZdZdZdd�Zd�Zdd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Z�fd�Zdd�Zdd�Z	dd�Zd�Zdd�Zdd�Zd�Zd�Zdd�Zd�Z�xZS) �DistUpgradeViewKDEz$KDE frontend of the distUpgrade toolc��tj|�t�jd�t	j
d�}|j
tj�|r|dk(rUtjjtj�d�}ttj��|_
nd}t|�|_
	tjd|�tj d�dtj&vrt#d	��d
tj&d<dtj&d
<dtj&d<d
tj&d<t)dg�|_t-|j*�}t/t0�t2k(r'|j5t7j8�ddd�n&|j5t7j8�ddd�|j*j;|�t=�j?�tAdddg��}|j*jC|�tE�|_#|jFjI|�|jFjK�d|_&tO|jFjP|jFjR�|_*tW|�|_,t[|�|_.t_|�|_0|jbtd_3|jFjhjkd�|jFjhjljo|jp�tjd|�tj d�|js�tu�jvd}|r|dk(rd}|jjydd�}	t{j|�j|	�}
|jFj�j��}|j�d|�}|j�d|
�}|jFj�j�|�|jFj�j��t�|jFj��|_G|jFj�j�d d!�t�|j`|jFj��|_J|j�j�|j��|j�jK�t�j�d"|j��|j*j��y#t"$r#}t	j$d|z�Yd}~���d}~wwxYw)#N�KDE�PyQt4�.�moz)/usr/share/locale/ubuntu-release-upgraderzubuntu-release-upgraderzError setting locales (%s)�DISPLAYzNo DISPLAY in os.environ foundr:�QT_PLATFORM_PLUGIN�TRUE�KDE_FULL_SESSION�5�KDE_SESSION_VERSION�QT_QPA_PLATFORMTHEME�qtr�z/usr/share/qt5/translationsz/usr/share/qt4/translationszsystem-software-updatez=/usr/share/icons/oxygen/48x48/apps/system-software-update.pngz5/usr/share/icons/hicolor/48x48/apps/adept_manager.png�r?FrU�Ubuntu�Kubuntu�Sources�Toz%siXi��
)PrrR�
get_telemetry�set_updater_typer��	getLogger�setLevel�INFOr0r1�join�getcwdr rr"�bindtextdomain�
textdomainr�rJr�r
�appr	r;r
r<�loadr�system�installTranslatorr$�setupUrlHandlesrA�
setWindowIconrUr�rYr��	prev_stepr�r�r��_opCacheProgressr��_acquireProgressr��_cdromProgressr��_installProgress�_handleExceptionr��
excepthookrr
r&r'�showTerminalrrIrKr!�distro_info�UbuntuDistroInfor��label_titler�rr�rLrr�konsole_frame_layout�setMinimumSizerwrG�	addWidgetr�
singleShot�exitMainLoopMidFlightr)rF�datadir�logdir�logger�	localedirr�
translator�messageIconr>�to_dist�
to_version�title_strings            r,rRzDistUpgradeViewKDE.__init__4sJ��� � ��&���(�(��/��"�"�7�+��������%��'�S�.��G�G�L�L�����T�2�)�)�"�)�)�+�6�$�+�?�)�)�'�2�$�+�	<�
�
 �
 �!:�I�
F�
�
�
�6�
7��B�J�J�&��<�=�=�,1��
�
�'�(�*0��
�
�%�&�-0��
�
�(�)�-2��
�
�)�*��!:� ;�<���!����*�
�����$��O�O�G�N�N�,�d�C�9V�W��O�O�G�N�N�,�d�C�9V�W����"�"�:�.���$�$�&��4�'f�'^�'`�a��	
�����{�+�-�/������"�"�4�(���������� -�d�.>�.>�.P�.P�RV�Rb�Rb�Rp�Rp� q��� 9�$� ?���5�d�;��� 9�$� ?����.�.������+�+�6�6�u�=����+�+�3�3�;�;�D�<M�<M�N�	���8��C����4�5��&�&�(��|�"�"�=�1���t�x�'��D��+�+�/�/�)�T�2�� �1�1�3�;�;�G�D�
��'�'�3�3�8�8�:��#�+�+�H�d�;��#�+�+�D�*�=�����$�$�,�,�\�:�	
���&�&�+�+�-�$/��0@�0@�0N�0N�$O��!����&�&�5�5�c�3�?�)�$�*?�*?��AQ�AQ�A_�A_�`����!�!�+�+�D�,>�,>�?������!�	���"�d�8�8�9��������e�	<�
�/�/�6��:�
;�
;��	<�s�+V�	V=�V8�8V=c�N�td�|jj�y)Nr�)r4r~�exitrEs r,r�z(DistUpgradeViewKDE.exitMainLoopMidFlight�s��
�%�&����
�
�r.c���|dk(r|j}t|t�st|t�rst	|j��dk(r&|j
tjdd��n1|j
tt	|j����|j�dk7r8|j�D]$}|j|�|j|��&yy)N�Error�kdelibs)
r�r'rrrj�windowTitle�setWindowTitler"rr��children�translate_widgetr)rF�parentWidget�widgets   r,rz,DistUpgradeViewKDE.translate_widget_children�s����4���+�+�L��l�G�,�
�<��0Q��<�+�+�-�.�'�9��+�+�W�-=�-=�i��-Q�R��+�+�A�s�<�3K�3K�3M�/N�,P�Q�� � �"�d�*�&�/�/�1�
7���%�%�f�-��.�.�v�6�
7�+r.c��t|t�st|t��r%t|j	��dk(rGtjdtjd�d��}|jt|d��yt|j	��dk(rGtjdtjd�d��}|jt|d��yt|j	��dk7rB|jtt|j	���jdd��yyy)	Nz&Cancelr�T)�fallback�&Closeryr��&)r'rrrjr�r"�translationr}r�r#r�r)rFr�r�s   r,r�z#DistUpgradeViewKDE.translate_widget�s����f�f�%��F�K�)H��6�;�;�=�!�Y�.�!�-�-��w�1�1�)�<�t�M������w�	�B�C��V�[�[�]�#�x�/�!�-�-��w�1�1�)�<�t�M������w��A�B��V�[�[�]�#�r�)�����#�f�k�k�m�"4� 5� =� =�c�3� G�I�*�*Ir.c�T�t|t�st|t�rytj|||�}tjddj|�z�t|||�t�s�djtj|||��}t|j�}td|�|j|j�|jj!|�|j#�|j%�t'j(d�y)zCrash handler.Nz)not handled exception in KDE frontend:
%s�
ryrr)�
issubclass�KeyboardInterrupt�
SystemExit�	traceback�format_exceptionr�r�rzrrrr�r3r�dialog�crash_detailr�rGrr�r�)rF�exctype�excvalue�exctb�lines�tbtextr�s       r,r�z#DistUpgradeViewKDE._handleException�s���
�w� 1�2��w�
�+���*�*�7�H�e�D���
�
�B�T�Y�Y�u�EU�U�V�	�W�h��.��|��W�W�Y�7�7���5�Q�R�F��T�-�-�.�F��$�f�-��*�*�4�;�;�7����'�'��/������L�L�N�����r.c���|jjj�rS|jjj�|jjjt
d��nR|jjj�|jjjt
d��|jj�y)NzShow Terminal >>>z<<< Hide Terminal)	r�rLr7rrr�r�r�rGrEs r,r�zDistUpgradeViewKDE.showTerminal�s������)�)�3�3�5����*�*�/�/�1����/�/�7�7��:M�8N�O����*�*�/�/�1����/�/�7�7��:M�8N�O����#�#�%r.c��|jSr8)r�rEs r,�getAcquireProgressz%DistUpgradeViewKDE.getAcquireProgress�����$�$�$r.c�<�||j_|jSr8)r�r�)rF�caches  r,�getInstallProgressz%DistUpgradeViewKDE.getInstallProgress�s��',����$��$�$�$r.c��|jSr8)r�rEs r,�getOpCacheProgressz%DistUpgradeViewKDE.getOpCacheProgress�r�r.c��|jSr8)r�rEs r,�getCdromProgressz#DistUpgradeViewKDE.getCdromProgress�s���"�"�"r.c�N�|jjj|�yr8)r�r�r�)rFr�s  r,�
update_statusz DistUpgradeViewKDE.update_status�s�����%�%�-�-�c�2r.c���t|jd|jz�}t|jd|jz�}|j�|j�y)N�image_step%i�label_step%i)�getattrr�rlr)rFr��image�labels    r,�hideStepzDistUpgradeViewKDE.hideStep�sJ����(�(��$�*�*�)D�E����(�(��$�*�*�)D�E��
�
�
��
�
�
�r.c���|j}|rdt|jd|jz�}t	dgd���}|j|j
dd��|j�yy)Nr�z
dialog-cancel)z7/usr/share/icons/oxygen/16x16/actions/dialog-cancel.pngz@/usr/lib/kde4/share/icons/oxygen/16x16/actions/dialog-cancel.pngz4/usr/share/icons/crystalsvg/16x16/actions/cancel.pngro�)r�r�r�rlrA�	setPixmapr@r�)rFr�r��
cancelIcons    r,�abortzDistUpgradeViewKDE.abort�se���~�~����D�,�,�^�d�j�j�-H�I�E���*b�c�J�
�O�O�J�-�-�b�"�5�6��J�J�L�r.c����tt|�|�tdgd���}tdgd���}|jr�t|jd|jjz�}t|jd|jjz�}|j|jdd��|j�||_t|jd|jz�}t|jd|jz�}|j|jdd��|j�|jd	|j�zd
z�y)Nz	dialog-ok)z3/usr/share/icons/oxygen/16x16/actions/dialog-ok.pngz</usr/lib/kde4/share/icons/oxygen/16x16/actions/dialog-ok.pngz0/usr/share/icons/crystalsvg/16x16/actions/ok.pngrozarrow-right)z5/usr/share/icons/oxygen/16x16/actions/arrow-right.pngz>/usr/lib/kde4/share/icons/oxygen/16x16/actions/arrow-right.pngz9/usr/share/icons/crystalsvg/16x16/actions/1rightarrow.pngr�r�r�z<b>z</b>)
r�ra�setSteprAr�r�r�rlr�r@r�r�r�)rFr��okIcon�	arrowIconr�r�r�s      �r,r�zDistUpgradeViewKDE.setStep�s!���
� �4�0��6��{�"V�W���-�%b�c�	�
�>�>��D�,�,�^�d�n�n�>R�>R�-R�S�E��D�,�,�^�d�n�n�>R�>R�-R�S�E��O�O�F�M�M�"�b�1�2��J�J�L������(�(��$�*�*�)D�E����(�(��$�*�*�)D�E��
���	�(�(��R�0�1�
�
�
��
�
�
�e�e�j�j�l�*�V�3�4r.c�@�d|�d|��}t|j�}td|�|j|�|jj|�|dk7r6|jj|�|jj�n|jj�|jtd��tdgd���}|jj|jdd��|j�|j!�y)	Nrrr�Informationzdialog-information)z;/usr/share/icons/oxygen/48x48/status/dialog-information.pngzD/usr/lib/kde4/share/icons/oxygen/48x48/status/dialog-information.pngz=/usr/share/icons/crystalsvg/32x32/actions/messagebox_info.pngro�0)rr�r3rrr�rr�rr�r�rAr�r�r@rGr�rFrr��extended_msgrr�s      r,�informationzDistUpgradeViewKDE.informations���07��<���4�+�+�,��� �(�+��&�&�x�0����$�$�S�)��4���#�#�+�+�L�9��#�#�(�(�*��#�#�(�(�*�����-� 0�1��0�'h�i��	��� � ��!3�!3�B��!;�<��������r.c��d|�d|��}t|j�}td|�|j|�|jj|�|dk7r6|jj|�|jj�n|jj�tdgd���}|jj|jdd��|j�|j�y)	Nrrrzdialog-error)z5/usr/share/icons/oxygen/48x48/status/dialog-error.pngz>/usr/lib/kde4/share/icons/oxygen/48x48/status/dialog-error.pngzA/usr/share/icons/crystalsvg/32x32/actions/messagebox_critical.pngror�F)rr�r3rrr�rr�rrAr�r�r@rGrr�s      r,r�zDistUpgradeViewKDE.error/s���.5�s�;���4�+�+�,��� �(�+��&�&�x�0����$�$�S�)��4���#�#�+�+�L�9��#�#�(�(�*��#�#�(�(�*��N�'l�m��	��� � ��!3�!3�B��!;�<���������r.c
��tj|||||�t|j�|_td|j�|jjj�|jjjj|j�|j|j�|jjjtj�j!t#d��|jjjtj$�j't)��|jjjtj$�j!t#d�dz�t+dgd���}|jj,j/|j1dd��|d	k7r�|d
j3dd�}|jjjtj4�j!|�|d
j3dd�}	|jjjtj�j!|	�d|z}
|jj6j!|
�|jj8j!|j:�|jjj=�|jjj?dg�|jjjA�j�|jBD]]}|jjjEd
tG|jjt#d�|jHzg���_|jJD]]}|jjjEd
tG|jjt#d�|jHzg���_|jLD]]}|jjjEd
tG|jjt#d�|jHzg���_|jND]]}
|jjjEd
tG|jjt#d�|
jHzg���_|jPD]]}|jjjEd
tG|jjt#d�|jHzg���_|jjS�|jjU�}|tjVk(ryy)zshow the changes dialoguezdialog_changes.uiz&Start Upgrade�Details� >>>zdialog-warning)z7/usr/share/icons/oxygen/48x48/status/dialog-warning.pngz@/usr/lib/kde4/share/icons/oxygen/48x48/status/dialog-warning.pngz@/usr/share/icons/crystalsvg/32x32/actions/messagebox_warning.pngror�Nrr�ryrz<big><b>%s</b></big>�PackageszNo longer supported %sz	Remove %szRemove (was auto installed) %sz
Install %sz
Upgrade %sTF),r�confirmChangesrr��changesDialoguer3�treeview_detailsr�	buttonBox�
helpRequestedr'�showChangesDialogueDetailsr�buttonrr�r�r��Help�setIconrrA�question_pixmapr�r@rr��
label_summary�
label_changes�confirmChangesMessage�clear�setHeaderLabels�header�	demotions�insertTopLevelItemrr>�toRemove�toRemoveAuto�	toInstall�	toUpgraderGrr-)rFr�changesr��downloadSize�actions�removal_boldr��cancel�confirm�summaryText�demoted�rm�inst�uprRs                r,r�z!DistUpgradeViewKDE.confirmChangesGsU��
	�&�&�t�W�g�y�'3�	5�&�t�'7�'7�8����"�D�$8�$8�9����-�-�2�2�4����&�&�4�4�<�<�T�=\�=\�]��&�&�t�';�';�<����&�&�-�-�.>�.A�.A�B�J�J�1�M]�K^�_����&�&�-�-�.>�.C�.C�D�L�L�U�W�U����&�&�-�-�.>�.C�.C�D�L�L�Q�y�\�\b�Mb�c��,�'k�l��	
���,�,�6�6�{�7I�7I�"�b�7Q�R��d�?��Q�Z�'�'��R�0�F�� � �*�*�1�1�2B�2I�2I�J�R�R�SY�Z��a�j�(�(��b�1�G�� � �*�*�1�1�2B�2E�2E�F�N�N�w�W�,�w�6�����*�*�2�2�;�?����*�*�2�2�4�3M�3M�N����-�-�3�3�5����-�-�=�=�z�l�K����-�-�4�4�6�;�;�=��~�~�	o�G�� � �1�1�D�D�Q��X\�Xl�Xl�X}�X}�AB�C[�A\�_f�_k�_k�Ak�@l�Im�
o�	o��-�-�	]�B�� � �1�1�D�D�Q��X\�Xl�Xl�X}�X}�AB�CN�AO�RT�RY�RY�AY�@Z�I[�
]�	]��#�#�	r�B�� � �1�1�D�D�Q��X\�Xl�Xl�X}�X}�AB�Cc�Ad�gi�gn�gn�An�@o�Ip�
r�	r��N�N�	`�D�� � �1�1�D�D�Q��X\�Xl�Xl�X}�X}�AB�CO�AP�SW�S\�S\�A\�@]�I^�
`�	`��.�.�	^�B�� � �1�1�D�D�Q��X\�Xl�Xl�X}�X}�AB�CO�AP�SU�SZ�SZ�AZ�@[�I\�
^�	^�	
���'�'�)��"�"�(�(�*���'�"�"�"��r.c�J�|jjj�rs|jjj�|jjjtj�jtd�dz�nr|jjj�|jjjtj�jdtd�z�|jj�y)Nr�r�z<<< )r�r�r7rr�r�rr�r�r�r�rGrEs r,r�z-DistUpgradeViewKDE.showChangesDialogueDetailss������0�0�:�:�<�� � �1�1�6�6�8�� � �*�*�1�1�2B�2G�2G�H�P�P�QR�S\�Q]�`f�Qf�g�� � �1�1�6�6�8�� � �*�*�1�1�2B�2G�2G�H�P�P�QW�Z[�\e�Zf�Qf�g����'�'�)r.c���tj|j|d|ztjtjztj�}|tjk(ryy)Nz<font>TF)rr�r��Yes�No)rFrr��default�answers     r,�askYesNoQuestionz#DistUpgradeViewKDE.askYesNoQuestion�sS���%�%�d�&6�&6���C��Q\�Q`�Q`�al�ao�ao�Qo�q|�q�q�A���[�_�_�$��r.c��ttj||tj|j�}|j	tj
�}|j	tj�}|jtd��|dk(r|j|�n|j|�|�2|j�}|j|tjz�|j�}|tj
k(ryy)N�Continuer�TF)r�Warning�NoButtonr��	addButton�Applyr�r�r��setDefaultButton�windowFlags�setWindowFlagsr�FramelessWindowHintr)	rFrr�r�
messageBox�continueButton�cancelButton�flagsr	s	         r,�askCancelContinueQuestionz,DistUpgradeViewKDE.askCancelContinueQuestion�s��� ��!4�!4�g�s�K�DX�DX�Z^�Zj�Zj�k�
�#�-�-�k�.?�.?�@��!�+�+�K�,>�,>�?�����q��}�-��h���'�'��5��'�'��7��?��*�*�,�E��%�%�e�b�.D�.D�&D�E��!�!�#���[�&�&�&��r.c���ttjtd�td�tj|j�}|jtj�}|jtj�}|jtd�jdd��|jtjdd��|j�}|tjk(ryy	)
NzRestart requiredz<<b><big>Restart the system to complete the upgrade</big></b>z_Restart Nowr�r�r�r�TF)
r�Questionr�rr�rrrr�rr"rr)rFr�	yesButton�noButtonr	s     r,�confirmRestartz!DistUpgradeViewKDE.confirmRestart�s��� ��!5�!5�q�9K�7L�a�QO�OP�R]�Rf�Rf�hl�hx�hx�y�
��(�(����9�	��'�'����7�����!�N�+�3�3�C��=�>�����)�)�)�X�>�?��!�!�#���[�_�_�$��r.c�,�tj�yr8)r
r�rEs r,r�z DistUpgradeViewKDE.processEvents�s���"�"�$r.c��yr8ru)rFrs  r,�
pulseProgressz DistUpgradeViewKDE.pulseProgress�s��	
r.c��td�}|jdd�}tj|jtd�|tj
tj�}|tj
k(ryy)Nz�<b><big>Cancel the running upgrade?</big></b>

The system could be in an unusable state if you cancel the upgrade. You are strongly advised to resume the upgrade.r�z<br />zCancel Upgrade?TF)r�rrrJr�rr)rFr�r�s   r,r[z.DistUpgradeViewKDE.on_window_main_delete_event�si���w�x���|�|�D�(�+���$�$�T�%5�%5�q�9J�7K�T�S^�Sb�Sb�do�dr�dr�s���[�_�_�$��r.)NNr8)NT)r)r�)F)rqrrrsr�rRr�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
rrr�r!r[r�r�s@r,rara2s����.�d�L�
7�J��6&�%�%�%�#�3��	�5�2�.�237�6�p*���(	�%�
�	r.ra�__main__zinput box testz�bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar z--test-term�bashTg{�G�z�?z--show-in-terminal�g�������?)�purge)�strict)j�utilsr�ImportError�PyQt5r�PyQt5.QtCorerrr	r
r�PyQt5.QtWidgetsrr
rrrrrrrr�PyQt5.QtGuirrrrrd�PyQt4.QtCore�PyQt4.QtGuir�r�r�r!r)r��aptr�r�rnr0r��DistUpgradeApportrrrrrr�DistUpgradeConfigParserr �	telemetryr!rur�r"�DistUpgradeGettextr�r#r$r-r3r9rArGrDrIrwr��base�
CdromProgressr��
OpProgressr�r�r�rUrarq�viewr
�argvrGr�rQ�callr�r�r�rMr_rdr��charsr�r��Cacher�r�is_installed�
is_upgradable�mark_delete�mark_install�commitr�r�rur.r,�<module>rBsZ��.?� ��z�X�����K�K����E�D��
�����
����	�
�7�^�^�6�+�
��,�/�"��1��
��""�!�+�+������1�1�hH�9�H�V�c�l�l�/�/�=�=��*)�C�L�L�%�%�0�0�)�,2��2�jE��E�T���$M��M�`�z��	�	�$����(�*`�a��X�X�a�[�M�!����#�#�%�c�	���
�*�/�/�6�(�
#�
�#�(�(�*��
�
�
�
-�
-�
/�
$�,�
$�
$�
&�
�$�*�*�T�
�
�
	�X�X�a�[�(�(�����������&�&�(�%����!�
�
�
�
0�
0�!�
5�
$�,�
$�
$�
&�
�$�*�*�T�
�	�

�
$�,�
$�
$�
&�
��#�)�)�+�%�
�X�X�a�b�\� �c��S�z���u�S�z�'?�'?��C�j���4��(��C�j����	 �
�,�,�t�$�$�T�%:�%:�;�	
� �l� � �"�	
�G��u�?��K�K�?�?�?�?�?�?��T��s�A
M$�
N$�$9N!� N!�$N.

Zerion Mini Shell 1.0