%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	f1'����ddlmZdZdZdZdZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
�ddlmZmZmZmZmZmZdd	lmZd
Zd
Zd
Zdej6zZdZdId
�ZdJd�Zd�Z ed
ddfdezd
ddfejBdddejDejFejHejJejLddezddfddezddfejNdgZ(dKd�Z)	ddl*Z*ddl*m+Z+m,Z,	ejbeeeee(e2e3fe4e5e6fdd�"�	Z7e7jqd#gd$�d�%�\Z9ZZZ:Z;Z<ej�d&�re.j�d'�d(ZBdZCdZDdZEdZFdZGe9D]�\ZHZIeHd)vre)��eHd*k(r	e)d+�� eHd,k(r	e)d-��.eHd.vrdZF�5eHd/k(reJed0�1�ej`d��WeHd2vreIj��j��ZB�zeHd3vrd'ZB��eHd4vrdZC��eHd5vrdZD��eHd6vs��dZE��e.j�eB�se)�	e7j�dZNej�j�e�Ze.j�e.j�d7ez��ej�j�e�r	ej�e�e.j�e�e.j�e.j��e.j�d8�eDr,eCr*e.j_d9�e)�ej`d!�e.j�d:eNz�e[eN�d!kre)�ej`�eNrej�eN�\ZZ]Z^es#e.j_d;�ej`d�e.j�d<ez�ej�e�Z`e`re`j�d=eb�ebk(r#e.j_d>�ej`d!�e`j�d?ec�Zdedeck(r"e.j�d@�ej`�eDsdZCdZeej�dA�\ZgZhegdur]ej��dk(re.j_dB�n7e.j�dC�ej��ej�dA�\ZgZhegdk(rdZee.j�dD�ej��Zlelj��Znenej�k(re.j�dE�dZGn2enej�k(re.j�dF�ne.j�dG�eCreGseee�n
eDreGs	eeed�eEreGdurdZqndZqe eleqeN�e.j��e.j�dH�y#e-$r'e.j_d �ej`d!�Y���wxYw#e	jz$r?Z>e.j_e>j~�e)�ej`d!�YdZ>[>���dZ>[>wwxYw#eO$rd
ZNY���wxYw#eV$rY��iwxYw)L�)�print_functionz1.1z+AutoConfig Utility for Plug-in Installationzhp-check-pluginzbAuto config utility for HPLIP supported multifunction Devices for installing proprietary plug-ins.N)�*)�utils�device�tui�module�pkit�services)�
pluginhandler�z%s/hplip_ac.logzcom.hplip.StatusServicec��tjd�|||||||g}tjdtd�}|j
|ddi�t
�j|�tjd�y)Nzsend_message() entered�/�Event�	signature�ssisisszsend_message() returning)�log�debug�lowlevel�
SignalMessage�DBUS_SERVICE�append�	SystemBus�send_message)	�
device_uri�printer_name�
event_code�username�job_id�title�	pipe_name�args�msgs	         � /usr/share/hplip/check-plugin.pyrr7sg���I�I�&�'���j�(�F�E�9�U�D�
�
 �
 ��l�G�
<�C��C�J�J�T�*��*�
�K���S�!��I�I�(�)�Fc�z�|r�tj�s1tjdtz�tjd�	ddlm}m	}ddl
m}ddlm
}t
j�}t }t"}t%j&|t k(|�\}	}
|	r|
stjd�yy|r2t)t*d	t,t.dd
�tj1d�ytjd�y#t$r-tjd�tjd�Y��wxYw)
Nz+%s requires GUI support . Is Qt4 installed?�r)�QApplication�QMessageBox)�PluginDiagnose)�core_installz,Unable to load Qt4 support. Is it installed?zFailed to install plug-in.r�
AutoConfigzAEvent EVENT_AUTO_CONFIGURE sent to hp-systray to invoke hp-pluginz-Run hp-systray manually and re-plugin printer)r�canEnterGUIMode4r�error�__mod__�sys�exit�PyQt4.QtGuir'r(�ui4.plugindiagnoser)�	installerr*�ImportError�argv�PLUGIN_REQUIRED�PLUGIN_REASON_NONEr	�run_plugin_commandrr�EVENT_AUTO_CONFIGURErr)�systray_running_status�run_directlyr'r(r)r*�app�plugin�
plugin_reason�ok�sudo_oks           r#�install_PluginrAAs�����%�%�'��I�I�C�g�M�N��H�H�Q�K�	�=�9�.�
�3�8�8�$�� ��*�
��-�-�f��.G��W���G����I�I�2�3�!�	��j�2�';�X�q�,�W��	�	�U�V��	�	�A�B���	��I�I�D�E��H�H�Q�K�	�s�	D�3D:�9D:c�&�d}|dur�|dk7r�tjd�|dz
}tjd�\}}tjd�\}}|durH|durDd}|j	�t
k(rn4tjd	�tjd
�|dur|dk7r��d}d}|�|d
|zz
}tdk(r|dz
}||z}	tjd�tjd|	z�tj|	�\}
}y)NipFrg333333�?�z	hp-pluginzhp-diagnose_pluginTz\Failed to download firmware required files. manually run hp-plugin command in terminal fisrtr&zhp-firmwarerz -y3 %srz -gzStarting Firmware installation.zRunning command : %s )�time�sleepr�Is_Process_Running�	getStatus�PLUGIN_INSTALLEDrr-r/r0�	log_level�infor�run)�	pluginObj�Plugin_Installation_Completed�	USB_param�
sleep_timeout�	ps_plugin�output�ps_diagnose_plugin�execmd�options�cmd�Status�outs            r#�install_firmwarerX^s���M�
'�5�
0�]�a�5G��
�
�3��%�q�(�
� �3�3�K�@��	�&�$)�$<�$<�=Q�$R�!��6����"4��"=�,0�)��"�"�$�(8�8���	�	�x�y������(�5�
0�]�a�5G��F��G����9�i�(�(���G���5���	�'�	�C��H�H�
.�/��I�I�%�s�*�+��	�	�#��K�F�Cr$�nameTz$Usage: %s [OPTIONS] [USB bus:device]�summary)z'Install Plug-in through HP System Tray:z-m (Default)�optionF)z"Install Plug-in through hp-plugin:�-pr[F)z"Download firmware into the device:�-fr[FzInstall plugin:z$%s 001:002�examplezInstall plugin and firmware:z$%s -f 001:002)z*-m and -p options can't be used together. r�noteFc���|dk(rtjtt�tjt
|ttt�tjd�y)N�textr)	r�	log_title�	__title__�__version__�format_text�USAGEr.r/r0)�typs r#�usagerh�s8��
�f�}�
���	�;�/�	���e�S�)�W�k�B��H�H�Q�Kr$)rrz2hp-check-plugin Tool requires dBus and python-dbusr&)�run_as_root_ok�quietzl:hHuUmMfFpPgG)�gui�helpz	help-restzhelp-manz	help-desczlogging=)�handle_device_printer�HPLIP_DEBUGrrJ)z-hz-Hz--helpz--help-rest�restz
--help-man�man)z-uz-Uz--guiz--help-desc� )�end)z-lz	--logging)z-gz-G)z-mz-M)r\z-P)z-Fr]zSaving output in log file: %sz hp-check-plugin startedz.Both -m and -p options can't be used together.zparam=%szThis is not a valid devicez
Setting up device: %s
zsupport-typezUnsupported printer model.r=zThis is not a plugin device.z
hp-systrayz@ hp-systray must be running.
 Run 'hp-systray &' in a terminal. zStarting hp-systray servicezhp-systray service is running
z"Device Plugin is already installedzHP Device Plug-in is not foundz>HP Device Plug-in version mismatch or some files are corruptedzDone.)r)F)ra)r�
__future__rrdrcr.�__doc__r/�os�os.path�getopt�signal�operatorrD�base.g�baserrrrr	r
r3rrrr�prop�user_dir�LOG_FILErrrArX�
USAGE_OPTIONS�
USAGE_HELP�USAGE_LOGGING1�USAGE_LOGGING2�USAGE_LOGGING3�USAGE_EXAMPLES�USAGE_NOTESrfrh�dbusrrr4rr-r0�Module�INTERACTIVE_MODE�GUI_MODE�UI_TOOLKIT_QT3�UI_TOOLKIT_QT4�UI_TOOLKIT_QT5�mod�parseStdOpts�opts�mode�
ui_toolkit�loc�GetoptError�er"�getenv�	set_levelrI�Systray_Msg_Enabled�Plugin_option_Enabled�Firmware_Option_Enabled�GUI_Mode�Is_Plugin_Already_Installed�o�a�print�lower�stripr!�param�
IndexError�path�normpathrJ�bold�exists�remove�OSError�set_logfile�	set_where�LOG_TO_CONSOLE_AND_FILEr�len�makeURI�sane_uri�fax_uri�queryModelByURI�mq�get�SUPPORT_TYPE_NONE�PLUGIN_NONEr=�Systray_Is_RunningrF�statusrQ�getuid�run_systray�PluginHandlerLrG�
plugin_stsrH�PLUGIN_NOT_INSTALLEDrM�r$r#�<module>r�s��.&���9�	�
��
n���	��
�
����;�;�#���
�
����T�]�]�*��
&��
*�C�:�J�2�v�t�	$�
0�7�
:�B�	�4�	P�	�	�	�	U�	F�	F�	�	�	�	�	�	�u�3�3�U�5I�5I�	�	�	��m�W�5�y�%�
H�)�+;�W�+E�y�RW�
X�	�	�	�	G�
	
�� ���(�	�
�&�-�-���K��%��x� �>�>�>�"R�cg�os�u�C�

�	�	�*�+j�BG�	�
H�:�D�*�l�D�*�c�
�2�9�9�]���
�
�g���	���������#���#'�D�A�q��!�!�
��	
�m�	�
�f�
�	
�l�	�
�e��	
�"�	"���
�m�	�
�g�3��������	
�!�	!��G�G�I�O�O�%�	�	
�\�	��	�	
�l�	�"��	
�l�	� $��	
�k�	�"&��G#'�J�}�}�i� �	�G���H�H�Q�K�E��7�7���H�%��������1�H�<�	=�>��7�7�>�>�(��
���	�	�(��������
�
�c�)�)�*��	�	�
$�%��0��I�I�>�?�	�G��C�H�H�Q�K��	�	�*�u�
���u�:��>�	�G��C�H�H�J��$2�F�N�N�5�$9�!�J��'���I�I�*�+��C�H�H�Q�K��	�	�
%�
�
2�3��V���J�'��	�R�V�V�N�$5�
6�:K�
K��I�I�*�+��C�H�H�Q�K�	����+�	&��	�[���I�I�,�-��C�H�H�J������(��(�(��6�
��v�	�U�?��r�y�y�{�a���	�	�W�X����.�/������0��0�0��>�
��v�	�T�>����I�I�/�0�&�M�&�&�(�	�
�
 �
 �
"�
�
��/�/�/��H�H�
1�2�"&���=�5�5�5��H�H�
-�.��H�H�
M�N��&��*�+��&��*�D�1��"�e�+�(-�%�(,�%��Y� =�u�E����
�������y���	�	�F�G��������������	�	�!�%�%��
������������r���E����
��
�sN�U�*=V�	W�2W%�(V�V�W�4W�W�W"�!W"�%W.�-W.

Zerion Mini Shell 1.0