%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	fl)��z�ddlZddlZddlZddlZddlmZmZddlZddl�ddl	m
Z
mZddlm
Z
ejdej�Zejdej�ZdZdZd	ad	ad
�Zd!d�Zd"d�Zd#d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd$d�Z d%d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d�Z+d �Z,y)&�N)�Popen�PIPE)�*)�utils�services)�
to_bytes_utf8z(\d+\.\d+\.\d+)z
(\d+\.\d+)��c���tjdtjj	tj
d�d�zd��\}a|dk7rtjd�yy)Nz%s -p�ldconfigF��
log_outputrzldconfig failed.)	r�run�os�path�join�which�	ld_output�log�debug)�statuss �$/usr/share/hplip/installer/dcheck.py�update_ld_outputr/sQ���	�	�'�B�G�G�L�L����Z�9P�R\�,]�"]�jo�p��F�I�
��{��	�	�$�%��c�X�tjd||fz�tj|�\}}|dk7rtjd�y|r�	|j	�d}tj|�tj|�}	|jd�}	t|�}tjd||fz�||krtjd�||k\Stjd	�y
#t
$rd}Y��wxYw#t$rd}Y�ywxYw#t$rYywxYw)NzChecking: %s (min ver=%f)r�
Not found!Fr
r	zVer=%f Min ver=%f�"Found, but newer version required.�Found.T)rrrr�
splitlines�
IndexError�ver_pat�search�group�AttributeError�float�
ValueError)�cmd�min_verr�output�line�	match_obj�ver�v_fs        r�
check_toolr.7s���I�I�)�S�'�N�:�;��Y�Y�s�^�N�F�F�
��{��	�	�,����
��(�(�*�1�-��
�I�I�d�O����t�,�I�
��o�o�a�(��

&��C�j���	�	�-��g��>�?���=��I�I�B�C��g�~�%��I�I�h����-�
���
��"�
���
��
�
��
�s6�C;�D�!D�;D	�D	�D�D�	D)�(D)c��tjd|z�tj|�dk\rtjd�ytjd�y)NzChecking for library '%s'...rrTz
Not found.F)rrr�find)�libr(s  r�	check_libr2[sE���I�I�,�s�2�3��~�~�c��a���	�	�(��
��	�	�,��rc���tjd|�d|�d��tj|ddd|��D]}tjd|z�ytjd�y)	NzSearching for file '�' in '�'...TF��recurse�	abs_paths�return_folders�patternzFile found at '%s'zFile not found.)rrr�	walkFiles)�f�dir�ws   r�
check_filer?is[���I�I�a��=�>�
�_�_�S�$�$�u�^_�
`����	�	�&��*�+����I�I�� �rc�.�tjd|�d|�d��g}tj|ddd|��D](}tj|�|j	|��*|rtjd|z�|Stjd�|S)	N�Searching for file(s) 'r4r5TFr6�Found files: %s�No files not found.)rrrr;�append)r<r=�foundr>s    r�locate_filesrFss����I�I��C�@�A��E�
�_�_�S�$�$�u�^_�
`����	�	�!��
���Q���
��	�	�#�e�+�,��L�	�	�	�'�(��Lrc	�N�tjd|�d|�d|�d��g}tj|ddd|��D]5}t	||�s�tj|�|j|��7|rtjd|z�|Stjd	�|S)
zf
        Find a list of files located in a directory
        that contain a specified sub-string.
    rAr4z' that contain 'r5TFr6rBrC)rrrr;�check_file_containsrD)r<r=�srEr>s     r�locate_file_containsrJ�s���
�I�I�1�c�ST�U�V��E�
�_�_�S�$�$�u�^_�
`����q�!�$��I�I�a�L��L�L��O�	�
��	�	�#�e�+�,��L�	�	�	�'�(��Lrc��tjd|�d|�d��	tjj	|�rbt|�}t
|d�D]H}t�||vs�tjd|jdd��d|�d	��t�y
tjd�	t�y#t�wxYw)
NzChecking file 'z' for contents 'r5�rb�'�
rz' found in file 'z'.TzContents not found.F)
rrrr�existsr�open�update_spinner�replace�cleanup_spinner)r<rI�as   rrHrH�s����I�I�1�a�@�A��
�7�7�>�>�!���a� �A��!�T�]�
 ��� ���6��I�I�A�I�I�e�S�<Q�ST�U�V��	��
 �	�	�	�'�(��	�����s�AC�&-C�C�Cc	�V�|�tjd|z�	|D]Z}t�tj|�\}}|dus�*|D]!}tjd||�d|�d���#t�ytjd�	t�y#t�wxYw)N�*Searching for '%s' in running processes...TzFound: z (�)�	Not foundF)rrrQr�Is_Process_RunningrS)�process_list�pr�processs    r�check_psr]�s������	�	�>��M�N���	�A���"�5�5�a�8�N�F�7���~� �B�A��I�I�'�!�*�a�@�A�B��
	��	�	�	�	�+��������s�+B�'B�:B�B(c�^�i}|��tjd|z�	|D]n}t�tj|�\}}|dur1tjdt|�z�|D]
}||||<��Ztjd��p	t
�|S|S#t
�wxYw)NrVTzFound: %d processesrX)rrrQrrY�lenrS)�process_name_list�processes_listr[r�	processes�pids      r�
get_ps_pidrd�s����N��$��	�	�>�AR�R�S�	�&�
+��� �#(�#;�#;�A�#>� ��y��T�>��I�I�3�c�)�n�D�E�(�<��-6�s�^��s�+�<��I�I�k�*�
+�
����>���
��s�A3B � B,c���tsMtjd�}tjtj
j
|d�d��\}atj|�dk\S)N�lsmodFr
r)�
mod_outputrrrrrrr0)�modulerfrs   r�check_lsmodri�sN������G�$��"�Y�Y�r�w�w�|�|�E�7�'C�PU�V���
��?�?�6�"�a�'�'rc�
�tjd|�d|���d}|dk7r3tj|�}	|j	d�}	t
|�}d}|dk7r3tj|�}	|j	d�}	t
|�}||krtjd�ytjd	�y
#t
$rd}Y��wxYw#t$rd}Y��wxYw#t
$rd}Y�lwxYw#t$rd}Y�qwxYw)NzChecking: installed ver=z
  min ver=r�-r	r
rFrT)rrr!r"r#r$r%r&)�inst_ver_str�min_ver_strr(r+r,�inst_vers      r�
check_versionro�s���I�I�,��T�U��G��c���.�.��-�	�	��/�/�!�$�C�	��C�j�G��H��s���.�.��.�	�	��/�/�!�$�C�	��S�z�H�
�'���	�	�6�7���	�	�(����3�	��C�	���	��G�	���	��C�	���	��H�	�sG�C�C�3C#�C4�C�C�C �C �#C1�0C1�4D�Dc��tjd|z�tj|�\}}|dk7rtjd�|S	|j	�d}tj|�tj|�}	|jd�}|S#t
$rd}Y�KwxYw#t$r?tj|�}	|jd�}|cYS#t$r|cYcYSwxYwwxYw)NzChecking: %srrr
r	)rrrrrr �ver1_patr"r#r$r!)r'�def_verrr)r*r+r,s       r�get_versionrs�s����I�I�n��$�%��Y�Y�s�^�N�F�F�
��{��	�	�,����	��$�$�&�q�)�D�	�	�	�$���O�O�D�)�	�	��/�/�!�$�C��J��!�	��D�	���	����t�,�I�
��o�o�a�(���
��"�
���
��		�sB�B�B0�B-�,B-�0C8�C$� C8�$C4�/C8�3C4�4C8c	��	ddl}d}	|j}|S#t$rO	dj|jD�cgc]
}t|���ncc}wc}�}n#t$rd}YnwxYwY|SwxYw#t$rd}Y|SwxYw)Nrrk�.)�dbus�__version__r$r�version�str�ImportError)rv�dbus_version�xs   r�get_python_dbus_verr}s�������	#��+�+�L�����	#�
#�"�x�x����(F�A��Q��(F��(F�G���!�
#�"��
#����	#��
�������sZ�A2��	A/�A�A
�
A�A/�A(�%A/�'A(�(A/�+A2�.A/�/A2�2B�Bc��tjd�d}	ddl}ddlm}|j}|S#t
$rd}Y|SwxYw)NzChecking PyQt 4.x version...rkr��QtCore)rr�PyQt4r��PYQT_VERSION_STRrz)r,r�r�s   r�get_pyQt4_versionr�%�N���I�I�,�-�	�C�&��	!��%�%���J�������J����1�A�Ac��tjd�d}	ddl}ddlm}|j}|S#t
$rd}Y|SwxYw)NzChecking PyQt 5.x version...rkrr)rr�PyQt5r�r�rz)r,r�r�s   r�get_pyQt5_versionr�3r�r�c��	tjd�ddl}t|j�}|S#t
$rYywxYw)NzTrying to import 'reportlab'...rrk)rr�	reportlabry�Versionrz)r�r,s  r�get_reportlab_versionr�@sB����	�	�3�4���)�#�#�$���
������s�.2�	>�>c��tjd�	ddl}	|j}|j
d�dkr|dz
}|j
d�dkr�|S#t$r|j
}Y�GwxYw#t$rYywxYw)NzChecking PyQt 3.x version...rru�z.0rk)rr�qtr�r$�PYQT_VERSION�countrz)r��pyqtVersions  r�get_pyQt_versionr�Js����I�I�,�-���
	*��-�-�K�����$�q�(��4��K�����$�q�(����
�	*��/�/�K�	*��
����s"�A3�A�A0�/A0�3	A?�>A?c�>�d}	tgd�t��}|j�djd�}|rYt	j
d�}|j
�d}|j|�r |j|�jd�}|S#d}Y�cxYw)Nrk)�xsanez	--version�2�>z	/dev/null)�stdoutrzutf-8zxsane-(\d{1,}\.\d{1,}).*r	)	rr�communicate�decode�re�compilerr"r#)�
installed_ver�p1r)�
xsane_ver_pat�xsane_ver_infos     r�get_xsane_versionr�]s����M�3�
�=�d�
K���~�~���"�)�)�'�2����z�z�"A�B�
��*�*�,�Q�/������/�)�0�0��@�F�F�q�I�M�������s�B�Bc�B�	ddl}|jS#t$rYywxYw)Nrrk)�PILrwrz)r�s r�get_pil_versionr�ns*�� ��
���	��	����s��	�c��	ddl}ddl}ddl}|j|jjd�|jdd�}|j|j_	|j�S#t$rYywxYw)Nr�cTrk)�sys�ctypes�ctypes.util�CDLL�util�find_library�DEFAULT_MODE�c_char_p�gnu_get_libc_version�restyperz)r�r��LIBCs   r�get_libpthread_versionr�xsn��+�'�'�
�{�{�6�;�;�3�3�C�8��9L�9L�T�SW�X��,2�O�O��!�!�)��(�(�*�*��
����s�A0�0	A<�;A<c��	ddl}dj|jjjD�cgc]
}t|���c}�Scc}w#t$rYywxYw)Nrrurk)�xml.parsers.expatr�parsers�expat�version_inforyrz)�xmlr|s  r�get_python_xml_versionr��sR��K� ����#�+�+�*;�*;�*H�*H�I�Q�#�a�&�I�J�	J��I������s�A�A�	A�Ac�"�tjS)N)�proprx�rr�get_HPLIP_versionr��s���<�<�rc�N�tjddd�dk(rtd�Sy)N�	configurezlibusb01-build�no�yeszlibusb-config --versionz1.0)�sys_conf�getrsr�rr�get_libusb_versionr��s'���|�|�K�!1�4�8�E�A��4�5�5�r)g)r)z/usr/include)z0.0)rk)-r�os.pathr�r��
subprocessrr�codecs�base.g�baserr�base.sixextrr��
IGNORECASErqr!�PID�CMDLINErrgrr.r2r?rFrJrHr]rdrirorsr}r�r�r�r�r�r�r�r�r�r�r�rr�<module>r�s���.
��	�
�"�
�� �%��2�:�:�,�b�m�m�<��
�"�*�*�&��
�
�
6����
��
�	�
�
�&�!�H����(�&�"�*(� �F�8
�����&�" �	+�K��r

Zerion Mini Shell 1.0