%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/system-config-printer/troubleshoot/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/system-config-printer/troubleshoot/__pycache__/CheckUSBPermissions.cpython-312.pyc

�

Hf���\�ddlZddlZddlZddlmZddlZddl�ddlm	Z	Gd�de
�Zy)�N)�TimedSubprocess�)�*)�Gtkc�$�eZdZd�Zd�Zd�Zd�Zy)�CheckUSBPermissionsc�z�tj||d�|jtj�|�y)NzCheck USB permissions)�Question�__init__�new_pager�Label)�self�troubleshooters  �D/usr/share/system-config-printer/troubleshoot/CheckUSBPermissions.pyrzCheckUSBPermissions.__init__ s+�����4��1H�I��������t�4�c
��i|_|jj}|dr|dry|d}|d}n|jdd�r|d}nytjj|�\}}|dvryd	}t
j|tj�syd
}t
j|tj�sytjj�}d|d<|jj�}		t|	|d
gd|tjtjtj��|_|j j#�\}
}}i}
d}|
D�]p}|��|j%d�dk7r|j%d�dk7s(|j%d�dk7rV|j%d�dk7rB|
ji�}|jg�}|j'|�|||<||
|<d}��gd�}g}d}|}|t)|�kr|||\}}|j+|�snbt)|�}|dk(r t)|�}|j'||d�n||z}|j'|||�||d}|dz
}|t)|�kr�||t)|�kr��<|j+d�s
|ddk7r��W|d|d|d|d�}|d}|d}��si}g}|j+d�s$|j-t/j.d��|
j1�D]K\}}|j1�D]3\} }!|!D])}"d|"d �d!|"d"��}#|j'|#�|"d#||#<�+�5�Mg}$|D]�}#	t|	||#gd|tjtjtj��|_|j j#�\}%}&}|%D�'cgc]}'t)|'�dkDs�|'��}(}'|j|#|#�})|$j'|)|(f���|$|jd$<y#YyxYwcc}'w#g}(Y�IxYw)%N�cups_queue_listed�
is_cups_classF�cups_printer_dictz
device-uri�cups_device_listed�cups_device_uri)�hp�hpfax�usb�halz/sbin/lsusbz/usr/bin/getfacl�C�LC_ALLz-vT)�parent�args�	close_fds�env�stdin�stdout�stderr�bInterfaceClass���z	7 Printer�bInterfaceSubClassz	1 Printer))zBus �)z Device r()z: ID �)�:r))� r&rrr��03f0r))�bus�dev�name�fullr(z/dev/usb/lp?z
/dev/bus/usb/r.�/r/r1�getfacl_output)�answersr�get�urllib�parse�	splittype�os�access�X_OK�environ�copy�
get_windowr�
subprocess�DEVNULL�PIPE�op�run�find�append�len�
startswith�extend�glob�items)*rr4r�
device_uri�scheme�rest�LSUSB�GETFACL�new_environr�lsusb_stdout�lsusb_stderr�result�	dev_by_id�this_dev�line�this_mfr_id�mfr�this_mdl_id�mdl�
separators�fields�i�p�sep�length�start�end�infos�paths�mfr_id�mdls�mdl_id�devsr/�path�perms�getfacl_stdout�getfacl_stderr�x�output�infos*                                          r�displayzCheckUSBPermissions.display$si������%�%�-�-���&�'���'�� '�(;� <��*�<�8�J�
�[�[�.��
6� �!2�3�J�����/�/��<�����6�6�����y�y�%����)��$���y�y�'�2�7�7�+���j�j�o�o�'�� #��H���$�$�/�/�2��	�%�f�-2�D�M�15�+6�-7�-?�-?�.8�o�o�.8�o�o�
?�D�G�48�7�7�;�;�>�0�\�<���	��� �1	$�D��$��)�)�.�/�2�5��)�)�[�)�R�/��)�)�1�2�b�8��)�)�[�)�R�/��m�m�[�"�5���g�g�{�B�/���
�
�H�%�#&��K� �),�	�+�&����&�J�
�F��A��A��c�:�&�&� *�1�
�
��f��|�|�S�)���S�	���R�<��q�'�C��M�M�1�U�V�9�-��&�.�C��M�M�1�U�3�<�0��c�d�G���Q����c�:�&�&��3�
�#�#���$�$�d�+��q�	�V�0C�� &�q�	� &�q�	�!'���!%�(�H�!��)�K� ��)�K�c1	$�f����� � �$�'��L�L�$�)�)�^�4�5�%�O�O�.�	.�L�F�D� $�
�
�
�
.�����.�C�36�u�:�s�5�z�J�D��L�L�$�'�"%�f�+�E�$�K�.�
.�	.����	*�D�
�)�&�18�$��59�/:�1;�1C�1C�2<�/�/�2<�/�/�
C���<@�7�7�;�;�>�8����%3�C��s�A�w��{�!�C��C�
�9�9�d�D�)�D��L�L�4��.�)�!	*�$*/����%�&���w	���\D��
���s2�A!P0�:A%P<�P7�3P7�7P<�0P4�7P<�<Qc��|jS�N)r4�rs r�collect_answerz"CheckUSBPermissions.collect_answer�s���|�|�rc�8�|jj�yrr)rB�cancelrss r�cancel_operationz$CheckUSBPermissions.cancel_operation�s�������rN)�__name__�
__module__�__qualname__rrprtrw�rrrrs��5�C�J�rr)rIr9r?�timedopsr�urllib.parser6�base�
gi.repositoryrr
rr{rr�<module>r�s*��.�	��$����N�(�Nr

Zerion Mini Shell 1.0