%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/hplip/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/hplip/__pycache__/upgrade.cpython-312.pyc

�

=	fl<��N�ddlmZdZdZdZdZddlZddlZddlZddl	Z	ddl
Z
ddlZddl�ddl
�ddlmZmZmZmZmZmZddl�dd	lmZed
ddfd
ezd
ddfej0ej2dej0ej4ej6ej8ej:ej<dddddgZe Z!dZ"ejFjId�Z%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-d
Z.d�Z/dqd�Z0drd�Z1d�Z2d�Z3d�Z4d �Z5d!�Z6d"�Z7e8jse�	ejteeeeee e;fe<e=e>fd�Z?e?j�d#gd$�d�%�\ZAZBZCZ!ZDZEej��dk(r$e8j�e�d&eKeL����e1d'�ej�d(�re8j�d)�eAD�]b\ZOZPeOd*vre0��eOd+k(r	e0d,��!eOd-k(r	e0d.��/eOd/vrePj��ZR�DeOd0k(reSed&�1�e1dd��]eOd2vr8ePj��j��ZUe8j�eU�r��e0���eOd3vre8j�d)���eOd4k(r$eVZ!e8j�d5�e0�e1dd���eOd6k(rePZ"��eOd7k(rePZ%��eOd8k(rdZ&��eOd9vr#e8j�d:�e0�e1dd���eOd;k(rdZ'�� eOd<k(rdZ(��)eOd=k(rdZ,��2eOd>k(r#e8j�d?�e0�e1dd���ZeOd@k(s��adZ-��ee(se'se,sde?_Xe?j��e(se're?j�dAd�ne?j�dBd�ejFj�dCe\j�z�Z^ejFj�e^�r	ej�e^�e8j�e^�e8j�e8j��e8j�dDe8j�e^�z�e8j�d
�	egd�ehei�Zjej��se8j�dE�e1d'�elj�dFdGdH�Zne8j�dIenz�e5�ZoeodHk(re8j�dJ�e1d'�epj�dBdKeo�e'dure8j�dLeoz��n�e(du�r�ej�eneo�se8j�dM��n�dNeozZIejj��rd'ZtndOZteDdPk(r�ej��se8j�dQez�e1d'�	ddlv�ddRlwmxZxezej��Z|e}j�e|edT�e|e�dU��exdd
ddeteI�Z�e��j�e8j�dV�e|�j��n�e�j�se8j�dWez�e1d'�	ddXl�mzZzm�Z�ddYl�m�Z�ezej��Z|e�deteI�Z�e��j�e8j�dV�e|�j��nje&dur�ej�eneo�rXe,re8j�d[eoz�e�jd\eozd]d^gd]�\Z�Z�e�re�d^k(r8e8j�d_eoz�e1dd�ne8j�dM�e1dd�ejj��se8j�d`�e1d�e�j�se1d'�e"re"�daeo�db�Z�e"�daeo�dc�Z�e"Z%�n}e8j�dd�e8j�deej�j!�j��j#�z�ejFj�e%�s�e8j�e8j�dfe%z��ee8j�dg��Z�e�dhk(re8j�di�e1d'�n�ejFj�e��s,e8j�e8j�dje�z��e1d'�n[e�j&e�e�j(e�j*z�s,e8j�e8j�dke�z��e1d'�ne�Z%e7e%eo�\Z�Z�e�j,�Z�e��j1e�e��\Z�Z�e�e�k7r1e�e�e�e�fvre6e��s"e1d'�ne8j�e��e1d'�e�j>�Z.e�j@e%�dle�zZ�e8j�dme�z�e�jDe��Z�e�j@e.�e�dk(r!e8j�e8j�dn��n#e8j�e8j�doe�z��egd�e?�jI�e/�y#ej�$r-ZGe8j�eGj��e0�YdZG[G���dZG[GwwxYw#ea$rY��kwxYw#ey$re8j�dS�e1d'�Y���wxYw#ey$re8j�dZ�e1d'�Y��mwxYw#e�$r3e.re�j@e.�e,se8j�dp�e1d'�YywxYw)s�)�print_functionz1.0zHPLIP upgrade latest versionz
hp-upgradez-HPLIP installer to upgrade to latest version.N)�*)�utils�tui�module�os_utils�services�
validation)�input��nameTzUsage: %s [OPTIONS]�summary)zRun in interactive mode:z-i or --interactive (Default)�optionF)zCheck for update and notify:�--notifyrF)zCheck only available version:�--checkrF)z2Specify the path to the .run file on local system:z-p<path>rF)z Download HPLIP package location:z'-d<path> (default location ~/Downloads)rF)zIOverride existing HPLIP installation even if latest vesrion is installed:�-orFz~/DownloadsFz+http://hplip.sourceforge.net/hplip_web.confz@https://developers.hp.com/hp-linux-imaging-and-printing/gethplipz1http://sourceforge.net/projects/hplip/files/hplipc�`�trtjd�			�y#t$rYywxYw)Nz'

Please close this terminal manually. )�DONOT_CLOSE_TERMINAL�log�info�KeyboardInterrupt���/usr/share/hplip/upgrade.py�
hold_terminalrGs;������<�=�	������
!�	��	�s�!�	-�-c���|dk(rtjtt�tjt
|ttt�t�tjd�y)N�textr)
r�	log_title�	__title__�__version__�format_text�USAGE�__mod__r�sys�exit)�typs r�usager'Qs=��
�f�}�
���	�;�/�	���e�S�)�W�k�B��O��H�H�Q�Krc��ts6ts0ts*tj	d�tj	d�td�tj�t�tj|�y)NrzDone.T)�NOTIFY�
CHECKING_ONLY�
IS_QUIET_MODErr�change_spinner_state�mod�unlockInstancerr$r%)�code�waitTerminals  r�
clean_exitr1YsD���-�
�������������������O��H�H�T�Nrc��d}tjj|�s|S	t|d�}|j�}|j�D]9}d|vs�|j|�r |j|�jd�}nt
jd|z�|S#t$rt
j
d|z�|cYSwxYw)N�0.0.0�rz7Failed to get hplip version since %s file is not found.z<title>HP Developers PortalrzLatest HPLIP version = %s.)�os�path�exists�open�IOErrorr�error�read�
splitlines�search�group�debug)�hplip_version_file�pat�ver�fp�data�lines      r�parse_HPLIP_versionrFcs���
�C�
�7�7�>�>�,�-��
���#�S�)���7�7�9�D����!���(�D�0��z�z�$���j�j��&�,�,�Q�/���	��I�I�*�S�0�1��J�����	�	�K�L^�^�_��
��s�B'�'#C
�C
c��d}tjt�\}}|dk(r3t|�}|j	ddd�}tj|�|S)Nr3r�HPLIP�Latest_version)r�download_from_network�#HPLIP_VERSION_INFO_SOURCEFORGE_SITE�
ConfigBase�getr5�unlink)�HPLIP_latest_ver�sts�HPLIP_Ver_file�hplip_version_confs    r�"get_hplip_version_from_sourceforgerSxsZ���� �5�5�6Y�Z��C��
�a�x�'��7��-�1�1�'�:J�7�S��
�	�	�.�!��rc��d}tjd�}tjt�\}}|dk(r!t||�}t
j|�|S)Nr3z\d\.\d\d\.\d|\d\dr)�re�compilerrJ�HPLIP_WEB_SITErFr5rN)rOrArPrQs    r�&get_hplip_version_from_hplipopensourcerX�sR����
�*�*�)�
*�C��5�5�n�E��C��
�a�x�.�~�s�C��
�	�	�.�!��rc�8�t�}|dk(r
t�}|S)Nr3)rXrS)rOs r�get_latest_hplip_versionrZ�s"��=�?���7�"�=�?���rc��tjtj|��tjdddgd�\}}|r|dk(ryy)NzKDo you want continue without Digital Signature verification (y=yes, n=no*):�y�nFT)rr:�boldr�enter_choice)�msg�ok�choices   r�#digital_signature_fail_confirmationrc�sF���I�I�c�h�h�s�m��� � �!n�qt�ux�py�z}�~�I�B�v�
��3���rc�L�t�d|�d|�d�}|�d|�d�}tjd|z�tj||d�\}}tjd�t
jj|�stjd|z�ytjd	|z�|d
z}|d
z}tj||�\}}tjd�t
jj|�stjd|z�|dfS||fS)N�/�/hplip-�.runz0Downloading hplip-%s.run file..... Please wait. TrzFailed to download %s file.)rrz4Downloading hplip-%s.run.asc file..... Please wait. z.asc)	�HPLIP_PACKAGE_SITErrrrJr5r6r7r:)�path_to_download�
hplip_version�url�
hplip_packagerP�
download_file�hplip_digsigs       r�download_hplip_installerro�s���1�=�-�P�C�(8�-�H�M��H�H�
?�
�
M�O��3�3�C���M��C�
��H�H�R�L�
�7�7�>�>�-�(��	�	�/�
�=�>���H�H�
C�M�
Q�S�!�&�(�L�

�v�+�C��3�3�C��F��C�
��H�H�R�L�
�7�7�>�>�,�'��	�	�/�
�=�>��b� � ��,�&�&rzhl:gniup:d:of:sw)�notify�check�helpz	help-restzhelp-manz	help-desc�interactive�guizlang=zlogging=r?)�handle_device_printer� ��HPLIP_DEBUGr?)z-hz--helpz--help-rest�restz
--help-man�man)z-qz--langz--help-desc)�end)z-lz	--logging)z-gz--debugz-nz*NON_INTERACTIVE mode is not yet supported.z-pz-dr)z-uz--guizGUI is not yet supported.rrz-sz-fz%Option from file is not yet supportedz-wrq�upgradez%s/hp-upgrade.logzUpgrade log saved in: %sz8Either Internet is not working or Wget is not installed.�hplip�versionr3z%HPLIP previous installed version =%s.z&Failed to get latest version of HPLIP.�latest_available_versionzAvailable HPLIP version =%s.z-Latest version of HPLIP is already installed.z(Latest version of HPLIP-%s is available.��qt3z5%s requires GUI support. Is Qt3 Installed?.. Exiting.)�UpgradeFormz-Unable to load Qt3 support. Is it installed? zlastWindowClosed()zquit()zStarting GUI loop...z6%s requires GUI support . Is Qt4 installed?.. Exiting.)�QApplication�QMessageBox)�
UpgradeDialogz,Unable to load Qt4 support. Is it installed?z'Newer version of HPLIP-%s is available.z9Press 'y' to continue to upgrade HPLIP-%s (y=yes*, n=no):r\r]z1Recommended to install latest version of HPLIP-%szsPlease install HPLIP manually as mentioned in 'http://hplipopensource.com/hplip-web/install/manual/index.html' siterfrgz.run.ascz)
 Calling download_hplip_installer(...) 
z
 System Time : %s 
zNo such file or directory%sz7Please specify the path to download. Press 'q' to quit:�qzUser selected to quit.z,Specified path does not exist. Exiting...%s
z;Specified path do not have enough permissions Exiting...%s
zsh %sz
Upgrading  %szUpgrade is Completed.z%Upgrade Failed or Skipped. status: %sz	User exit)r)rT)��
__future__rr rr#�__doc__�getoptr5r$rU�time�datetime�base.g�base.strings�baserrrrr	r
�installer.core_install�base.sixext.movesr�USAGE_SPACE�
USAGE_MODE�
USAGE_OPTIONS�
USAGE_HELP�USAGE_LOGGING1�USAGE_LOGGING2�USAGE_LOGGING3r"�INTERACTIVE_MODE�mode�EXISTING_PACKAGE_PATHr6�
expanduser�PATH_TO_DOWNLOAD_INSTALLER�
FORCE_INSTALLr*r)rKrWrhr+r�CURRENT_WORKING_DIRrr'r1rFrSrXrZrcror�
set_module�Module�GUI_MODE�UI_TOOLKIT_QT3�UI_TOOLKIT_QT4�UI_TOOLKIT_QT5r-�parseStdOpts�opts�
device_uri�printer_name�
ui_toolkit�loc�GetoptError�er:r`�geteuid�queryString�ERROR_RUNNING_AS_ROOT�getenv�	set_level�o�a�lower�language�print�strip�	log_level�NON_INTERACTIVE_MODEr�quiet�	showTitle�lockInstance�normpath�prop�user_dir�log_filer7�remove�OSError�set_logfile�	set_where�LOG_TO_CONSOLE_AND_FILEr?r^r,�CoreInstall�
MODE_CHECK�core�check_network_connection�sys_confrM�installed_versionrO�	user_conf�set�Is_HPLIP_older_version�is_auto_installer_support�distro_type�canEnterGUIMode�qt�ui.upgradeformr��ImportErrorr��argv�app�QObject�connect�SIGNAL�SLOT�dialog�show�	exec_loop�canEnterGUIMode4�PyQt4.QtGuir��ui4.upgradedialogr��exec_r_rarb�close_running_hp_processes�downloaded_file�digsig_file�now�	isoformat�
download_path�access�R_OK�W_OK�GPG_Verification�gpg_obj�validate�
digsig_sts�	error_str�
ERROR_SUCCESS�ERROR_UNABLE_TO_RECV_KEYS�ERROR_DIGITAL_SIGN_NOT_FOUND�ERROR_DIGITAL_SIGN_BAD�getcwd�chdir�cmd�executerPr.rrrr�<module>r�sH
��,&���*�	�
��
9��+�*�*���C�C�$�#��2�v�t�	$�
�'�
)�2�y�$�	?�	�	�	�	�	�	�	W�	�	�	�	�	�	�	�	�	�	�	�	�u�3�3�U�5I�5I�	C�	C�	Z�	g�	j�	
��&�����7�7�-�-�m�<���
��
���%R�#�R��H���
���������*
����'�4���w��
�
�&�-�-���K��%�%�x�0�#�^�^�D�d�L�C�
��� 2�5g�+0� �2�:�D�*�l�D�*�c��2�:�:�<�1���I�I��+�.C�"D�E�F��q�M��2�9�9�]���M�M�'���7$�D�A�q����
��	
�m�	�
�f�
�	
�l�	�
�e��	
��	��7�7�9��	
�m�	�
�g�3���1�U��	
�!�	!��G�G�I�O�O�%�	��}�}�Y�'��G�	
��	��
�
�g��	
�d��#�����=�>�
���1�U��	
�d����	
�d��#$�"�	
�d���
�	
�o�	����,�-�
���1�e��	
�i���
�	
�j����	
�d���
�	
�d�����8�9�
���1�e��	
�d��#��o7$�r�m�M��C�I��M�M�O�	�]����W�T�"����Y�t�$�
�7�7���/��
�
�=�>���7�7�>�>�(��
���	�	�(��������
�
�c�)�)�*��	�	�
$�s�x�x��'9�
9�:��	�	�"�
�[�����
�#�D�)�5�)�)�+��	�	�L�M��1�
��l�l�7�9�W�=���I�I�5�7H�H�I�/�1���7�"��	�	�:�;��1�
�
�M�M�)�6�7G�H�����	�	�0�1A�A�B�	�4��+�u�+�+�,=�?O�P��I�I�E�F�=�=M�M�C��-�-�/������U�"�,�u�,�,�.��I�I�U�X_�_�`��q�M�"�$�:�#�3�8�8�,������V�,@�%A�3��X��W�$�T�2�a��+�s�C�����
��	�	�0�1��
�
��.�u�-�-�/��I�I�V�Y`�`�a��q�M�"�E�?�
#�3�8�8�,��&�t�[�#�>�����
��	�	�0�1��	�	���E�!�+�u�+�+�,=�?O�P� ��H�H�F�GW�W�X�,�C�,�,�-h�iy�-y�|�AD�|E�FI�J�	��6��V�s�]��H�H�P�Qa�a�b��q�%�(����H�I��1�U�#��-�-�/��H�H�K�
L��q�M�2�x�2�2�4��q�M� �1F�HX�Y�O�1F�HX�Y�K�)>�&��I�I�C�D��I�I�.�x�/@�/@�/D�/D�/F�/K�/K�/M�/W�/W�/Y�Y�Z��7�7�>�>�"<�=��	�	�#�(�(�#@�A[�#[�\�]� %�c�h�h�/h�&i� j�
� �C�'��H�H�5�6��q�M������
�6��I�I�c�h�h�'V�Wd�'d�e�f��q�M�"����=�"�'�'�B�G�G�2C�D��I�I�c�h�h�'e�fs�'s�t�u��q�M�1>�.�+C�D^�`p�+q�(�O�[�.�*�-�-�/�� '� 0� 0��+� N��
�I���&��8�:V�Xn�o�o�:�9�E��q�M��	�	�)�$��1�
�(�b�i�i�k������+�,���(���	�	�/�O�3�4��h���s�#������$�%��!�8��H�H�S�X�X�5�6�7��H�H�S�X�X�E�c�I�J�K���������O��[�����I�I�a�e�e��	�G�G����d�
��
��`#�"��I�I�M�N��q�M�"��*#�"��I�I�L�M��q�M�"��p�������$�%���	�	�+���q�M��s��;g�!h�D*i,�?h"�
B"i,�-i�;Oi,�h�&"h�h�h�h�"i�i,�i�i,�i)�%i,�(i)�)i,�,5j$�#j$

Zerion Mini Shell 1.0