403Webshell
Server IP : 209.205.66.10  /  Your IP : 216.73.216.173
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ammon 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
User :  ( 1006)
PHP Version : 8.5.8
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/system-config-printer/troubleshoot/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/system-config-printer/troubleshoot/__pycache__/ErrorLogCheckpoint.cpython-310.pyc
o

3�b�#�@s�ddlmZddlZddlZddlmZddlZddlZddlm	Z	m
Z
ddlTzddlm
Z
WndZ
YGd	d
�d
e�ZdS)�)�GtkN)�NamedTemporaryFile)�TimedOperation�OperationCanceled�)�*)�journalFc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�ErrorLogCheckpointcCs�t�||d�|�td�td��}tj�td��}t��}|�d�|�	tj
j�|�|ddd�||_
|�|ddd�t��|_|j�dd�|j�d�|�|jddd�|�||�i|_dS)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�	buttonbox�r"�C/usr/share/system-config-printer/troubleshoot/ErrorLogCheckpoint.pyr&s"
�


zErrorLogCheckpoint.__init__cCs�|j�dd�s	dS|jjd}|��}|�d�|��}tt|�	���dkr(dSd|t
j<|jj}|jd}|�dd�|d<|�|�dS)	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_settingsr"r"r#�__del__;s�


zErrorLogCheckpoint.__del__cCs�i|_|jj}|ds
dS|d|_|j��}dd�}zt||d�|_|j��}Wnty3YdStj	y>i}Ynwd|_
|j�d�t
t|����dkrTd	S||jd
<zt|tj�dkrfWdSWd	StyrYd	Sty{Yd	Sw)N�cups_queue_listedF�_authenticated_connectioncSs(t�dd��t�d�t��}|��S)NcSsdS)N�r")�xr"r"r#�<lambda>XszGErrorLogCheckpoint.display.<locals>.getServerSettings.<locals>.<lambda>r<)r2�
setPasswordCB�	setServer�
Connectionr.)r6r"r"r#�getServerSettingsVs
z5ErrorLogCheckpoint.display.<locals>.getServerSettings��parentr<rTr')r+r�authconn�
get_windowr�op�run�RuntimeErrorr2�IPPError�forward_allowedr�set_textr/r0r1r�intr3�KeyError�
ValueError)rr+rDrBr7r"r"r#�displayMs@

�
����zErrorLogCheckpoint.displaycCs|j�d|j|�|_dS)N�clicked)r�connect�enable_clicked�button_sigid)r�handlerr"r"r#�connect_signalsxs
�z"ErrorLogCheckpoint.connect_signalscCs|j�|j�dS�N)r�
disconnectrT�rr"r"r#�disconnect_signals|sz%ErrorLogCheckpoint.disconnect_signalsc
Cs�|jj}|ds
iS|j��}|j�|j�d|jvr|jSt�}zt|jjdgd|i|d�|_	|j	�
�WnDttj
fyP}z||jd<WYd}~n/d}~wtjyz}z||jd<|jj}|d}|��|_|j|jd<WYd}~nd}~wwzt�|j�}Wn
ty�gd	�}Ynw|d
|jd<|d
|jd<tr�t��}|��|��d}||jd<||jd<tj�t���}	|	�d
�}
|
|jd<|
|jd<|jS)Nr:�error_log_checkpointz/admin/log/error_log�file)�args�kwargsrD�error_log_checkpoint_excr%r;)rrrrrrr��__CURSOR�error_log_cursorz%F %T�error_log_timestamp)rr+rF�updaterrrrE�getFilerGrHrIr2rJ�	HTTPErrorr,�os�stat�name�OSErrorr�Reader�	seek_tail�get_previous�datetime�
fromtimestamp�time�strftime)rr+rD�tmpf�e�factory�statbuf�j�cursor�now�	timestampr"r"r#�collect_answersX

��

��	�




z!ErrorLogCheckpoint.collect_answercCs|jSrW)rKrYr"r"r#�can_click_forward�sz$ErrorLogCheckpoint.can_click_forwardc
	Cs�|j��}|j��zt|jj|d�|_|j��}Wntj	t
fy3|j��d|_||�YdSw|�
�|jd<d}z	t|tj�}WntyQd}Ynwzt||�}Wn
ttfygd}Ynw|dksp|dkr�d|tj<d||<d	}d
d�}	ztdt|��t|	|j|f|d
�|_|j��d}Wntj	y�Yn	ty�Ynw|r�d|jd<|j�td��n|j�td��d|_|j��||�dS)NrCTr'r(r���r&�1FcSsZ|�|�d}|dkr+zt�d�|��WdSty$|d7}Ynw|dksdSdS)Nr�)r4rp�sleep�_connectrI)�
connectionr7�attemptr"r"r#�set_settings�s

��z7ErrorLogCheckpoint.enable_clicked.<locals>.set_settingszSettings to set: )r]rDr$zDebug logging enabled.z"Debug logging was already enabled.)rrF�busyrrEr.rGrHr2rJr�readyrK�copyrrMr3rNrO�
debugprint�reprrIrrLr)
rrrUrDr7�
MAXLOGSIZE�
prev_debug�prev_logsize�successr�r"r"r#rS�sf

�
���
�
�
�
z!ErrorLogCheckpoint.enable_clickedcCs4|j��|jj}|d}|��|_|j|jd<dS)Nr%r;)rG�cancelrr+r,rE)rr+rtr"r"r#�cancel_operation�s


z#ErrorLogCheckpoint.cancel_operationN)�__name__�
__module__�__qualname__rr9rPrVrZrzr{rSr�r"r"r"r#r	%s+1Ar	)�
gi.repositoryrr2rg�tempfilerrnrp�timedopsrr�base�systemdrrr	r"r"r"r#�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit