%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__/CheckNetworkServerSanity.cpython-312.pyc

�

Hf����ddlmZddlZddlZddlZddlZddlZddlmZm	Z	ddl
�	ddlZGd�de�Z
y#Y�xYw)�)�GtkN)�TimedSubprocess�TimedOperation�)�*c�$�eZdZd�Zd�Zd�Zd�Zy)�CheckNetworkServerSanityc�z�tj||d�|jtj�|�y)NzCheck network server sanity)�Question�__init__�new_pager�Label)�self�troubleshooters  �I/usr/share/system-config-printer/troubleshoot/CheckNetworkServerSanity.pyrz!CheckNetworkServerSanity.__init__'s+�����4��1N�O��������t�4�c�h
�i|_|jj}d|vrd|vry|jj�}|d}|jdd�}d}|rm	t	j
||�}|D�cgc]
}|dd��}}d}||jd	<|jdd
�}	|r|	r\	|j|	�nI|	rG|	}d}nB|d}	t	j
||�}|D�
cgc]
}
|
dd��}}
||jd	<d}||jd<|�rV|jdd
�dv�rA|jd�dk(rtj}ntj}	ttj|||d�|��|_|jj�}d}
|
|jd<|
r�	tj"|��|_|jj�d}||jd<|ro|jdi�}|jdd�}|rI	tj$d|i|��|_|jj�}||jd<|�r]d}	t'j(�}|jd}t|j*d|zf|��|_|jj�}t|j,|��|_|jj�}d|jd<||jd<|��d|vr�|djdd
�}t3j4|�}|j7�\}}}}}d}	t|j8d|�d|��t:j<df|��|_|jj�}d}||jd <|rqd!|vrm	t?|dd"d#d$|gt@jBt@jDt@jD�%�|_|jj�|jd!<yycc}w#tj$rd}Y���wxYw#t$r|	}d}Y��mwxYwcc}
w#tj$rd}Y���wxYw#t $rd}
Y��wxYw#d}Y���xYw#Y��KxYw#t.$rY���t $r+}|j0\}}||f|jd<Yd}~���d}~wwxYw#t $r}|j0\}}||f}Yd}~��ad}~wwxYw#YyxYw)&N�remote_server_name�remote_server_ip_addressF�remote_server_portiw�rT�remote_server_name_resolves��remote_server_try_connect�cups_device_uri_scheme�ipp)r�http�httpsr)�host�port�
encryption)�kwargs�parent�remote_server_connect_ipp)r#�remote_server_cups�cups_printer_dictz
device-uri�uri�remote_cups_queue_attributesz	smb://%s/)�argsr#�remote_server_smb�remote_server_smb_shareszsmb://�/i��#remote_server_smb_share_anon_access�remote_server_traceroute�
traceroutez-w�1)r#�	close_fdsr)�stdin�stdout�stderr)#�answersr�
get_window�get�socket�getaddrinfo�gaierror�index�
ValueError�cups�HTTP_ENCRYPT_REQUIRED�HTTP_ENCRYPT_IF_REQUESTEDr�
Connection�op�run�RuntimeError�getPrinters�getPrinterAttributes�smbc�Context�opendir�getdents�	NameErrorr)�smburi�SMBURI�separate�open�os�O_RDWRr�
subprocess�DEVNULL�PIPE) rr5r#�server_name�server_port�try_connect�ai�(family_socktype_proto_canonname_sockaddr�resolves�ipaddr�)family_socktype_proto_canonname_sockaddr1r!�c�ipp_connect�cups_serverr&r'�attr�context�name�dir�shares�e�s�u�groupr�share�user�password�
accessible�fs                                 r�displayz CheckNetworkServerSanity.display+sZ������%�%�-�-�� ��/�&�g�5���$�$�/�/�2���2�3���k�k�"6��<�����
!��'�'��k�B��IK�M�E�E�Q�G��J�M��M�"��;C�D�L�L�6�7��[�[�"<�b�A�F���+� ����/��$��"��!�"<�=�K�
!��'�'��k�B��JL�N�F�F�a�H��K�N��N�
;C�D�L�L�6�7��K�4?����0�1���K�K�1�5�9�>G�
G��{�{�4�5��@�!�7�7�
�!�;�;�
�	
$�(�$�/�/�:E�:E�@J�2L�28�	9���
�G�G�K�K�N��"��9D�D�L�L�4�5��(�,�a�m�m�F�K�D�G��G�G�K�K�N�"&�K�6A����1�2��(/���5H�"�(M�%�+�/�/��t�D�C��!�&4�a�6L�6L�>C�S�\�=C�'E�D�G�$(�7�7�;�;�>�D�KO�D�L�L�)G�H���G�
B��,�,�/���|�|�$?�@��(�'�/�/�0;�d�0B�/D�17�9����g�g�k�k�n��(�#�,�,�v�F����������48����0�1�;A����7�8��"�':�g�'E��1�2�6�6��b�I���M�M�3�'��78�z�z�}�4���e�T�8�"�
�(�,�g�l�l�EI�EJ�5L�46�I�I�49�4;�6<�=�D�G�������A�!%�J�
GQ����B�C�
�&�g�5�

�)�&�D�1=�t�S�1<�1>�1;�1C�1C�2<�/�/�2<�/�/�C���<@�7�7�;�;�>����7�8�
��SM���?�?�
!� ��
!��&�+�'-��&*��	+��N���?�?�
!� ��
!��2 �
$�#��
$��(�"'�K��!� �� �
���
B������A�<=�q�6����7�8��
B��$$�(��V�V�F�Q��"#�Q��J��(��"
���s��Q�7Q�Q�0Q(�R�)Q<�8R�(AR�;8R/�+AR9�9B2S�4AT�A+T-�Q�Q%�$Q%�(
Q9�8Q9�<R�R�R�R,�+R,�/R6�9R>�	T�
T� S;�;T�	T*�T%�%T*�-T1c��|jS�N)r5�rs r�collect_answerz'CheckNetworkServerSanity.collect_answer�s���|�|�rc�8�|jj�yro)rA�cancelrps r�cancel_operationz)CheckNetworkServerSanity.cancel_operation�s�������rN)�__name__�
__module__�__qualname__rrmrqrt�rrr	r	&s��5�[�z�rr	)�
gi.repositoryrr=rOrKr8rQ�timedopsrr�baserFrr	rxrr�<module>r|s?��.��	�
�
��4��	��f�x�f��	��s�9�=

Zerion Mini Shell 1.0