%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	f�8��&�ddlZddlZddlZddlmZddlmZddlZddlZddl	Z	ddl
Z
ddl�ddlm
Z
ddlmZddlmZered	�Zd
�Ze
j&d	e
j&j(e
j&j*�Zej/d�dZd
ZdZdZdcd�ZGd�de�Ze�ZGd�de �Z!Gd�de!�Z"Gd�de!�Z#Gd�de!�Z$ejJd�e"�Z&e#�Z'e$�Z(	ejR�\e_e_*e&jYddd�e_-e
j\de
j^�gcZ0Z1ejZjed �ddD]6Z3e0jie3�Z5e5��e1jme5jod���8d jqe1�e_9	e:d	jqe1D�cgc]
}d!e:|�z��c}�d"�e_;e&jYd#d$ejxj{ejxj}ej~����e_@ej�ej���de_Cej�ej��ZEeEd%e_Fd&e_Gejxjqej�d'�e_Hejxjqej�d'd(�e_Iejxjqej�d'd)�e_Jejxjqej�d'd*�e_Kejxjqej�d'd+�e_Ld,e_Md-e_Nd.e_Od/e_Pd0e_Qd1e_Rd2e_See&jYd3d4d5��e_Tee&jYd3d6d5��e_Uee&jYd3d7d5��e_Vd8e_Wee&jYd3d9d5��e_Xee&jYd3d:d5��e_Yee&jYd3d;d5��e_Zee&jYd3d<d5��e_[ee&jYd3d=d5��e_\ee&jYd3d>d5��e_]ee&jYd3d?d5��e_^d@a_da`d8aadddA�ZbdB�ZcdC�ZddD�ZedE�ZfiegdF�ehdG�eidH�ejdI�ekdJ�eldK�emdL�endM�eodN�epdO�eqdP�erdQ�esdR�etdS�eudT�evdU�ewdV�exdWeydXezdYe{dZe|d[e}d\e~d]ed^e�d_i	�Z�Gd`�dae��Z�ddbiZ�y#e+$rde_de_*Y��MwxYwcc}w#e+$rde_;Y���wxYw)e�N�)�PY3)�configparser)�*)�logger)�os_utils)�
to_unicode�c��||kD||kz
S�N�)�a�bs  �/usr/share/hplip/base/g.py�cmpr+s���A��!�a�%� � ��info��c��t|t�r0|r.|dj�dvry|dj�dvry|St|t�r|S|S)Nr)�1�t�yT)�0�f�nF)�
isinstance�str�lower�bool)�s�defaults  r�to_boolr#9sU���!�S��a��Q�4�:�:�<�?�*��
�q�T�Z�Z�\�_�
,���N�
�A�t�	����Nrc��eZdZd�Zd�Zy)�
Propertiesc�\�|t|j��vr|j|�Sy)Nr
)�list�keys�__getitem__)�self�attrs  r�__getattr__zProperties.__getattr__Hs)���4��	�	��$�$��#�#�D�)�)�rc�(�|j||�yr)�__setitem__)r*r+�vals   r�__setattr__zProperties.__setattr__Ns������s�#rN)�__name__�
__module__�__qualname__r,r0r
rrr%r%Fs���$rr%c�V�eZdZd�Zed�fd�Zd�Zd�Zd�Zd�Z	e	Z
d�Zd	�Zd
�Z
y)�
ConfigBasec�d�||_tj�|_|j	�yr)�filenamer�ConfigParser�conf�read)r*r7s  r�__init__zConfigBase.__init__Vs"�� ��
� �-�-�/��	��	�	�rr
c��	|jj||�S#tjtjf$r|cYSwxYwr)r9�getr�
NoOptionError�NoSectionError)r*�section�keyr"s    rr=zConfigBase.get\sA��	��9�9�=�=��#�.�.���*�*�L�,G�,G�H�	��N�	�s��%A�Ac���|jj|�s|jj|�|jj|||�|j	�yr)r9�has_section�add_section�set�write)r*r@rA�values    rrEzConfigBase.setcsC���y�y�$�$�W�-��I�I�!�!�'�*��	�	�
�
�g�s�E�*��
�
�rc�6�|jj�Sr)r9�sections�r*s rrIzConfigBase.sectionsks���y�y�!�!�#�#rc�8�|jj|�Sr)r9rC�r*r@s  rrCzConfigBase.has_sectionos���y�y�$�$�W�-�-rc�8�|jj|�Sr)r9�optionsrLs  rrNzConfigBase.optionsss���y�y� � ��)�)rc���|j��|j}|jd�r#tjd|jz�y	t	|jd�}	|j
j
|�|j�yy#tj$r0td�tjd|jz�Y�Ttj$r5tjd|jz�|j�Y��wxYw#|j�wxYw#tttjf$r%tj!d|jz�YywxYw)N�/root/zattempted to read from '%s'�rr
zIFound No Section in %s. Please set the http proxy for root and try again.zFound Duplicate Entery in %sz#Unable to open file %s for reading.)r7�
startswith�log�error�openr9�	read_filer�MissingSectionHeaderError�print�DuplicateOptionError�warn�CheckDuplicateEntries�close�OSError�IOError�debug�r*r7�fps   rr:zConfigBase.readxs ���=�=�$��}�}�H��"�"�8�,��	�	�7�$�-�-�G�H��

Q��$�-�-��-��	��I�I�'�'��+��H�H�J�#%��$�=�=�{��"�I��I�I�i�lp�ly�ly�y�z�$�9�9�1��H�H�;�d�m�m�K�L��.�.�0�1���H�H�J���W�l�&L�&L�M�
Q��	�	�?�$�-�-�O�P�
Q�sQ�D3�%B�D3�AD�D�AD�D�D�D�D0�0D3�3AE6�5E6c��|j��|j}|jd�s|jd�r#tjd|jz�y	t	|jd�}|j
j
|�|j�yy#ttf$r%tjd|jz�YywxYw)NrPz/etc/zattempted to write to '%s'�wz#Unable to open file %s for writing.)r7rRrSrTrUr9rFr\r]r^r_r`s   rrFzConfigBase.write�s����=�=�$��}�}�H��"�"�8�,��0C�0C�G�0L��	�	�6����F�G��
Q��$�-�-��-���	�	����#����
�%���W�%�
Q��	�	�?�$�-�-�O�P�
Q�s�AB"�"1C�Cc���	t|jd�}|j�}|j�d}|j�D]}|r||vs�
|dz|z}�ddl}|j�\}|_t|jd�}|j|�|j�|j�tj|j�y#t$rd}Y��wxYw)NrQr
�
rrc)rUr7r:r\r^�
splitlines�tempfile�mkstemprF�os�unlink)r*r�data�
final_datarrg�fds       rr[z ConfigBase.CheckDuplicateEntries�s���	��T�]�]�3�'�A��6�6�8�D�
�G�G�I��
����"�	1�A��q�
�*�'��-�q�0�
�	1�	�$�,�,�.���D�M�����s�#��	���
��	���	��	�	��
�	�	�$�-�-� ���	��D�	�s�6C!�!C/�.C/N)r1r2r3r;r	r=rErIrCrNr(r:rFr[r
rrr5r5UsA���)3�2����$�.�*��D�Q�,Q�"!rr5c��eZdZd�Zy)�	SysConfigc�0�tj|d�y)Nz/etc/hp/hplip.conf)r5r;rJs rr;zSysConfig.__init__�s�����D�"6�7rN�r1r2r3r;r
rrroro�s��8rroc��eZdZd�Zy)�Statec���tjjd�sCtj�dk(r,tjd�d}tj|�tj|d�y)Nz/var/lib/hp/rzchmod 755 /var/lib/hp/z/var/lib/hp/hplip.state)	ri�path�exists�geteuid�makedirsr�executer5r;)r*�cmds  rr;zState.__init__�sO���w�w�~�~�n�-�"�*�*�,�!�2C��K�K��'�*�C����S�!����D�";�<rNrqr
rrrsrs�s��=rrsc��eZdZd�Zd�Zd�Zy)�
UserConfigc�F�tj�\}t_t	j
�dk(�s9tjjtjd�t_tjjtj�s�	ttjd�j�t	jtjjtj��}t	jtj|tj|tj �t$j'|tj�ydt_t$j'|d�y#t"$rY�RwxYw)Nrz
hplip.confrc)r�getHPLIPDir�prop�user_dirrirwru�join�user_config_filervrUr\�stat�dirname�chown�ST_UID�ST_GIDr^r5r;)r*�stsr!s   rr;zUserConfig.__init__�s��%�1�1�3���T�]��z�z�|�q� �$&�G�G�L�L�����$M�D�!��7�7�>�>�$�"7�"7�8����.�.��4�:�:�<����������0E�0E� F�G�A��H�H�T�2�2�A�d�k�k�N�A�d�k�k�N�S�
����d�&;�&;�<�%)�D�!�����d�+������s�B/F�	F �F c��|jddtjjd��}	|j	d�}tjd|z�|S#t
$rtjd|z�Y�=wxYw)N�	last_used�working_dir�~�utf-8zInvalid unicode: %s�working directory: %s)	r=riru�
expanduser�decode�UnicodeErrorrSrTr_�r*rs  r�workingDirectoryzUserConfig.workingDirectory�sr���H�H�[�-����1C�1C�C�1H�I��	2�����!�A�	�	�	�)�A�-�.�����	2��I�I�+�q�0�1�	2�s�A�!B�Bc��|jdd|jd��tjd|jd�z�y)Nr�r�r�r�)rE�encoderSr_r�s  r�setWorkingDirectoryzUserConfig.setWorkingDirectory�s6������m�Q�X�X�g�->�?��	�	�)�A�H�H�W�,=�=�>rN)r1r2r3r;r�r�r
rrr|r|�s��,�.�?rr|��en_US�UTF8�hplip�versionz0.0.0z(\d\w*)�.z%02x��dirs�home��2rk�images�xml�models�localizationi i�ZzP/usr/share;/usr/local/share;/usr/lib;/usr/local/lib;/usr/libexec;/opt;/usr/lib64z
HP-*.ppd.*z,http://www.linuxprinting.org/ppd-o-matic.cgiz
-hpijs.ppd�	configurez	gui-buildrz
network-buildzpp-buildTz
scanner-buildz	fax-buildz	doc-buildzfoomatic-xml-installzfoomatic-ppd-installzhpcups-installz
hpijs-installz\|/-\|/-c��|ayr)�enable_spinner)�enables r�change_spinner_stater�4s���Nrc�(�tr�tj�swtjj�rXtjj
dttz�tdzdzatjj�yyyy)N�r�)
r�rS�is_debug�sys�stdout�isattyrF�spinner�spinpos�flushr
rr�update_spinnerr�8s`���c�l�l�n����1B�1B�1D��
�
������ 0�0�1��1���!���
�
����2E�n�~rc���trrtj�s]tjj�r>tjj
d�tjj�yyyy)Nz )r�rSr�r�r�r�rFr�r
rr�cleanup_spinnerr�?sH���c�l�l�n����1B�1B�1D��
�
����!��
�
����2E�n�~rc	��	|jd�D�cgc]}t|jdd����}}|Scc}w#t$rg}Y|SwxYw)Nr�z+~)�split�int�	translate�
ValueError)�ver�x�ls   r�xintr�FsX���36�9�9�S�>�B�a�S����T�4�(�
)�B��B�
�H��
C�������H��s�A�";�A�A�A�Ac�>�d}|dz}ttjjd�d�}|ddk(rd}nd}t	j
d�D]\}}}||vs�|}d}�|dk(r-tjd|z�tjd�tjd	�}t|jd��}	|	ddk(rd}
nd}
||
k7rCtjd
|z�tjd�tjd�yy)Nrz.so� r�z	/usr/lib/rz6%s not present in the system. Please re-install HPLIP.zpython(\d(\.\d){0,2})z2%s Extension module is missing from Python's path.zMTo fix this issue, please refer to this 'http://hplipopensource.com/node/372')
r�r�r�r�ri�walkrSrT�exit�re�search�groupr)�ext_mod�flag�
ext_mod_so�
python_ver�dirpathr��	filenames�ext_path�m�ext_verr�s           r�check_extension_module_envr�Ns
���D��5��J��s�{�{�)�)�#�.�q�1�2�J��!�}����
��
�')�w�w�{�';��#���)���"��H��D��
�q�y��	�	�J�G�S�T������
�	�	�*�H�5�A��1�7�7�1�:��G��q�z�Q�������S���	�	�F��O�P����`�a������rzNo errorz
Unknown errorzDevice not foundzUnknown/invalid device-id fieldz Unknown/invalid device-uri fieldzData length exceeds maximumzDevice I/O errorzNo probed devices foundzDevice busyzDeviceStatus not availablezInvalid service namez!Invalid channel-id (service name)zChannel busyz!Device does not support operationzDevice open failedzInvalid device nodezInvalid hostname ip addresszInvalid JetDirect port numberzNo CUPS queue found for device.zDAT file errorzInvalid timeoutzI/O timeoutzIncompatible fax optionszInvalid fax filezFax file not foundzUnknown internal errorc��eZdZefd�Zy)�Errorc���||_tj|tt�|_t
j
d||jfz�tj||j|�y)NzException: %d (%s))	�opt�
ERROR_STRINGSr=�ERROR_INTERNAL�msgrSr_�	Exceptionr;)r*r�s  rr;zError.__init__�sR����� �$�$�S�-��*G�H����	�	�&�#�t�x�x��8�9����4����3�/rN)r1r2r3r�r;r
rrr�r��s
��)�0rr�)�us�en�en_us�american�america�usa�english)F)T)�r�ri�os.path�sixextr�sixext.movesr�locale�pwdr�r��codesr
rrr	�type�QStringr�Logger�LOG_LEVEL_INFO�LOG_TO_CONSOLErS�	set_level�MINIMUM_PYQT_MAJOR_VER�MINIMUM_PYQT_MINOR_VER�MINIMUM_QT_MAJOR_VER�MINIMUM_QT_MINOR_VERr#�dictr%r�objectr5rorsr|�umask�sys_conf�	sys_state�	user_conf�getdefaultlocale�encodingr�r=r��compile�I�_p�_xr��_y�match�_z�appendr�r��installed_versionr��installed_version_intru�realpath�normpath�getcwd�home_dir�getpwuid�getuid�username�getpwnam�pdb�userhome�history_size�data_dir�	image_dir�xml_dir�
models_dir�localization_dir�max_message_len�max_message_read�read_timeout�ppd_search_path�ppd_search_pattern�ppd_download_url�ppd_file_suffix�	gui_build�	net_build�	par_build�	usb_build�
scan_build�	fax_build�	doc_build�foomatic_xml_install�foomatic_ppd_install�hpcups_build�hpijs_buildr�r�r�r�r�r�r�r��
ERROR_SUCCESS�ERROR_UNKNOWN_ERROR�ERROR_DEVICE_NOT_FOUND�ERROR_INVALID_DEVICE_ID�ERROR_INVALID_DEVICE_URI�ERROR_DATA_LENGTH_EXCEEDS_MAX�ERROR_DEVICE_IO_ERROR�ERROR_NO_PROBED_DEVICES_FOUND�ERROR_DEVICE_BUSY�!ERROR_DEVICE_STATUS_NOT_AVAILABLE�ERROR_INVALID_SERVICE_NAME�ERROR_ERROR_INVALID_CHANNEL_ID�ERROR_CHANNEL_BUSY�'ERROR_DEVICE_DOES_NOT_SUPPORT_OPERATION�ERROR_DEVICEOPEN_FAILED�ERROR_INVALID_DEVNODE�ERROR_INVALID_HOSTNAME�ERROR_INVALID_PORT_NUMBER�$ERROR_NO_CUPS_QUEUE_FOUND_FOR_DEVICE�ERROR_DATFILE_ERROR�ERROR_INVALID_TIMEOUT�ERROR_IO_TIMEOUT�ERROR_FAX_INCOMPATIBLE_OPTIONS�ERROR_FAX_INVALID_FAX_FILE�ERROR_FAX_FILE_NOT_FOUNDr�r�r�r��supported_locales)r�s0r�<module>rAs���2�	���&�
�
��	�������2�h�G�!��f�m�m�B��
�
�4�4�f�m�m�6R�6R�S���
�
�f����������	�	$��	$��|��^!��^!�B8�
�8�
=�J�=�$?��$?�P	�������;��
�G�	�
�L�	��!8��!8�!8�!:��D�K���
�|�|�G�Y��8���	����J����	%�r���B�
�,�,�
�
�S�
!�"�1�
%��B�	���"��B�	�~�
�	�	�"�(�(�1�+���
���"����#�!$�R�W�W��-L�2�f�s�2�w�.>�-L�%M�r�!R�D�����V�V�R�W�W�-=�-=�b�g�g�>N�>N�y�r�y�y�{�>[�-\�]��
�����Y�R�Y�Y�[�)�!�,��
��c�l�l�4�=�=�!���A���
���������T�]�]�F�3��
������d�m�m�V�X�>����w�w�|�|�D�M�M�6�5�9����'�'�,�,�t�}�}�f�h�?��������T�]�]�F�N�K������������i���&���F���#�������k�;��D�E�������k�?�C�H�I�������k�:�s�C�D�������(�,�,�{�O�S�I�J�������k�;��D�E�������k�;��D�E���#�H�L�L��>T�VY�$Z�[���#�H�L�L��>T�VY�$Z�[����H�L�L��6F��L�M����8�<�<��_�c�J�K�����
�������
��F��
��#�o��'�);��(�*K�	�
)�+M��.�0M�
�&�(:��.�0I��"�M��2�4P��+�-C��/�1T��#�^��8�:]��(�*>�� &�(=�!�"'�)F�#�$*�,K�4�7X�#�%5�%�'8� �-�.�0J�*�,>�(�*>��!9�5�
�<0�I�0� � ^�`���I���D�K��D�M���.M���#�!"�D��#�s6�U!�V�!U;�3V�!U8�7U8�;V�V�V

Zerion Mini Shell 1.0