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

�

Hf�#���ddlmZddlZddlZddlmZddlZddlZddlm	Z	m
Z
ddl�	ddlm
Z
Gd	�d
e�Zy#dZ
Y�xYw)�)�GtkN)�NamedTemporaryFile)�TimedOperation�OperationCanceled�)�*)�journalFc�B�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�ErrorLogCheckpointc���tj||d�|jtd�td��}tj
j
td��}t	j�}|jd�|jtjj�|j|ddd�||_
|j|ddd�t	j�|_|jj!dd�|jj#d�|j|jddd�|j%||�i|_y)NzError log checkpoint�	Debuggingz�This step will enable debugging output from the CUPS scheduler.  This may cause the scheduler to restart.  Click the button below to enable debugging.zEnable DebuggingrFT)�Question�__init__�initial_vbox�_r�Button�new_with_label�
HButtonBox�set_border_width�
set_layout�ButtonBoxStyle�START�
pack_start�button�Label�label�
set_alignment�
set_line_wrap�new_page�persistent_answers)�self�troubleshooter�pager�	buttonboxs     �C/usr/share/system-config-printer/troubleshoot/ErrorLogCheckpoint.pyrzErrorLogCheckpoint.__init__&s�����4��1G�H�� � �!�K�.�"#�%L�#M�N��
���*�*�A�.@�,A�B���N�N�%�	��"�"�A�&����c�0�0�6�6�7����f�e�U�A�6��������E�5�!�4��Y�Y�\��
��
�
� � �!�Q�'��
�
� � �$�'�������U�E�1�5�����t�,�"$���c���|jjdd�sy|jjd}|j	�}|jd�|j
�}tt|j���dk(ryd|tj<|jj}|jd}|jdd�|d<|j|�y)	N�error_log_debug_logging_setF�!_authenticated_connection_factoryr�0�cups_server_settings�
MaxLogSize�2000000)
r �getr"�answers�get_connection�	_set_lock�adminGetServerSettings�len�list�keys�cups�CUPS_SERVER_DEBUG_LOGGING�adminSetServerSettings)r!�f�c�settingsr/�
orig_settingss      r%�__del__zErrorLogCheckpoint.__del__;s����&�&�*�*�,I�,1�3�����'�'�(K�L��
�����	���U���+�+�.����X�]�]�%�&�'�1�,��36���/�/�0��%�%�-�-���/�/�0F�G�
�!.�!2�!2�L�)�!L����	� � �(�+r&c�`�i|_|jj}|dsy|d|_|jj�}d�}	t	||��|_|j
j
�}d|_
|jjd�tt|j���dk(ry||j d	<	t#|tj$�dk7ry	y#t$rYytj$ri}Y��wxYw#t&$rYyt($rYywxYw)
N�cups_queue_listedF�_authenticated_connectionc��tjd��tjd�tj�}|j	�S)Nc��y)N��)�xs r%�<lambda>zGErrorLogCheckpoint.display.<locals>.getServerSettings.<locals>.<lambda>Xs�r&rC)r6�
setPasswordCB�	setServer�
Connectionr2)r:s r%�getServerSettingsz5ErrorLogCheckpoint.display.<locals>.getServerSettingsVs7������-��N�N�B�����"�A��+�+�.�.r&��parentrCrTr+)r/r"�authconn�
get_windowr�op�run�RuntimeErrorr6�IPPError�forward_allowedr�set_textr3r4r5r �intr7�KeyError�
ValueError)r!r/rLrJr;s     r%�displayzErrorLogCheckpoint.displayMs0������%�%�-�-���*�+��� ;�<��
��$�$�/�/�2��	/�	�$�&7��G�D�G��w�w�{�{�~�H� %����
�
���R� ���X�]�]�%�&�'�1�,��>F�D�#�#�$:�;�	��H�T�;�;�<�=��B��C���-�	���}�}�	��H�	���	����	���	�s0�,C2�D�2	D�=D�D�	D-�"D-�,D-c�\�|jjd|j|�|_y)N�clicked)r�connect�enable_clicked�button_sigid)r!�handlers  r%�connect_signalsz"ErrorLogCheckpoint.connect_signalsxs&�� �K�K�/�/��D�<O�<O�18�:��r&c�N�|jj|j�y�N)r�
disconnectr]�r!s r%�disconnect_signalsz%ErrorLogCheckpoint.disconnect_signals|s�������� 1� 1�2r&c� �|jj}|dsiS|jj�}|jj|j�d|jvr|jSt�}	t
|jjdgd|i|��|_	|jj�	t!j"|j$�}|d
|jd<|d
|jd<t(r�t)j*�}|j-�|j/�d}||jd<||jd<t0j0j3t5j4��}	|	j7d
�}
|
|jd<|
|jd<|jS#ttjf$r}||jd<Yd}~��9d}~wtj$rc}||jd<|jj}|d}|j�|_|j|jd<Yd}~���d}~wwxYw#t&$rgd	�}Y���wxYw)Nr?�error_log_checkpointz/admin/log/error_log�file)�args�kwargsrL�error_log_checkpoint_excr)r@)rrrrrrr��__CURSOR�error_log_cursorz%F %T�error_log_timestamp)r"r/rN�updater rrrM�getFilerOrPrQr6rR�	HTTPErrorr0�os�stat�name�OSErrorr	�Reader�	seek_tail�get_previous�datetime�
fromtimestamp�time�strftime)r!r/rL�tmpf�e�factory�statbuf�j�cursor�now�	timestamps           r%�collect_answerz!ErrorLogCheckpoint.collect_answers$���%�%�-�-���*�+��I��$�$�/�/�2�������T�4�4�5�!�T�\�\�1��<�<��!�#��	F�$�d�m�m�&;�&;�.D�-E�06��~�/5�7�D�G�
�G�G�K�K�N�	,��g�g�t�y�y�)�G�07�q�z����+�,�:A�!�*���� 6�7�����!�A�
�K�K�N��^�^�&�z�2�F�/5�D�L�L�+�,�:@�D�#�#�$6�7��#�#�1�1�4�9�9�<�@�C����g�.�I�2;�D�L�L�.�/�=F�D�#�#�$9�:��|�|���=�d�m�m�,�	9�78�D�L�L�3�4���~�~�	F�78�D�L�L�3�4��)�)�1�1�G��A�B�G�#�2�2�5�D�M�8<�
�
�D�L�L�4�5��	F���	,�+�G�	,�s8�AG�I<�I9�+H�I9�AI4�4I9�<
J
�J
c��|jSra)rSrcs r%�can_click_forwardz$ErrorLogCheckpoint.can_click_forward�s���#�#�#r&c��|jj�}|jj�	t|jj
|��|_|jj�}|j�|jd<d}	t|tj �}	t||�}|dk(s|dk7r�d|tj <d||<d	}d
�}		t'dt)|�z�t|	|j|f|��|_|jj�d}|rXd|jd
<|j,j/t1d��n$|j,j/t1d��d|_|jj�||�y#tjtf$r,|jj�d|_||�YywxYw#t"$rd}Y��cwxYw#t"t$f$rd}Y��lwxYw#tj$rY��t*$rY��wxYw)NrKTr+r,r���r*�1Fc��|j|�d}|dkr(	tjd�|j�yyy#t$r|dz
}YnwxYw|dkr�C�)Nr�)r8r{�sleep�_connectrQ)�
connectionr;�attempts   r%�set_settingsz7ErrorLogCheckpoint.enable_clicked.<locals>.set_settings�sg���1�1�8�<�����l�%��
�
�A��"�+�+�.���	#��
(�%��1���%����l�s�%A�A�AzSettings to set: )rhrLr(zDebug logging enabled.z"Debug logging was already enabled.)r"rN�busyrrMr2rOrPr6rRr�readyrS�copyr rUr7rVrW�
debugprint�reprrQrrTr)
r!rr^rLr;�
MAXLOGSIZE�
prev_debug�prev_logsize�successr�s
          r%r\z!ErrorLogCheckpoint.enable_clicked�s���$�$�/�/�2����� � �#�	�$�d�m�m�&J�&J�-3�5�D�G��w�w�{�{�~�H�;C�-�-�:J���� 6�7��
�	��h�t�'E�'E�F�G�J�	���� 4�5�L���?�l�c�1�7:�H�T�3�3�4�#&�H�Z� ��G�
%�

��/�$��/�A�B�(�,�04�
�
�x�/I�17�9������������IM��'�'�(E�F��
�
�#�#�Q�'?�%@�A��J�J����#G�!H�I�#������!�!�$�����q�
�
�0�1�	����%�%�(�#'�D� ��V���		���	��J�	���*�%�	��L�	��:�=�=�
���
��
�sP�AF?�H�3H�)AH1�?AH�H�H�H�H.�-H.�1I�I�Ic���|jj�|jj}|d}|j	�|_|j
|jd<y)Nr)r@)rO�cancelr"r/r0rM)r!r/rs   r%�cancel_operationz#ErrorLogCheckpoint.cancel_operation�sQ���������%�%�-�-���=�>���.�.�1��
�48�M�M����0�1r&N)�__name__�
__module__�__qualname__rr=rXr_rdr�r�r\r�rDr&r%rr%s3��%�*,�$)�V:�3�/�b$�?�BBr&r)�
gi.repositoryrr6rr�tempfilerryr{�timedopsrr�base�systemdr	rrrDr&r%�<module>r�sC��,��	�'���6����VB��VB����G�s	�=�A

Zerion Mini Shell 1.0