HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/lib/python3.6/site-packages/dnf/automatic/__pycache__/emitter.cpython-36.pyc
3

_��g��@sddlmZddlmZddlmZddlmZddlZddlZddl	Z	ddl
ZddlZddl
Z
ed�Zed�Zed�Zed	�Zejd
�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�dee�ZGdd�dee�ZGdd�de�ZGdd�de�ZdS)�)�absolute_import)�print_function)�unicode_literals)�_Nz0The following updates have been applied on '%s':zUpdates completed at %sz,The following updates are available on '%s':z.The following updates were downloaded on '%s':�dnfc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�EmittercCs"d|_d|_d|_||_d|_dS)NF)�_applied�_available_msg�_downloaded�_system_nameZ
_trans_msg)�self�system_name�r�/usr/lib/python3.6/emitter.py�__init__)s
zEmitter.__init__cCs�g}|jr<|jt|j�|j|j�|jttjd��nL|jr`|jt	|j�|j|j�n(|jr�|jt
|j�|j|j�ndSdj|�S)Nz%c�
)r�append�APPLIEDrr	�APPLIED_TIMESTAMP�timeZstrftimer
�
DOWNLOADED�	AVAILABLE�join)r�msgrrr�_prepare_msg0szEmitter._prepare_msgcCs|js
t�d|_dS)NT)r	�AssertionErrorr)rrrr�notify_applied@s
zEmitter.notify_appliedcCs
||_dS)N)r	)rrrrr�notify_availableDszEmitter.notify_availablecCs|js
t�d|_dS)NT)r	rr
)rrrr�notify_downloadedGs
zEmitter.notify_downloadedN)�__name__�
__module__�__qualname__rrrrrrrrrr(s
rcs0eZdZ�fdd�Z�fdd�Zdd�Z�ZS)�EmailEmittercstt|�j|�||_dS)N)�superr"r�_conf)rr
�conf)�	__class__rrrMszEmailEmitter.__init__csX|jrtd�|j}n0|jr,td�|j}n|jrBtd�|j}ndS|tt|�j�fS)NzUpdates applied on '%s'.zUpdates downloaded on '%s'.zUpdates available on '%s'.)NN)rrrr
r	r#r"r)r�subj)r&rrrQszEmailEmitter._prepare_msgc	Cs�|j�\}}tjj|�}|jd�|jj}|jj}tj	j
�|d<||d<||d<dj|�|d<tj	j�|d<y0t
j|jjdd	�}|j|||j��|j�Wn@tk
r�}z$td
�|jj|f}tj|�WYdd}~XnXdS)Nzutf-8ZDateZFromZSubject�,ZToz
Message-IDi,)Ztimeoutz$Failed to send an email via '%s': %s)rr�pycompZ
email_mimeZset_charsetr$�
email_from�email_to�emailZutilsZ
formatdaterZ
make_msgid�smtplibZSMTPZ
email_hostZsendmailZ	as_string�close�OSErrorr�logger�error)	rr'�body�messager*r+Zsmtp�excrrrr�commit\s$
zEmailEmitter.commit)rr r!rrr5�
__classcell__rr)r&rr"Lsr"c@seZdZdZdd�ZdS)�CommandEmitterMixIna^
    Executes a desired command, and pushes data into its stdin.
    Both data and command can be formatted according to user preference.
    For this reason, this class expects a {str:str} dictionary as _prepare_msg
    return value.
    Meant for mixing with Emitter classes, as it does not define any names used
    for formatting on its own.
    cCs�|jj}|jj}|j�}tdd�|j�D��}|jf|�}|jf|�jd�}tj	|dtj
d�}|j|�|jj
�|j�dkr�td�||jf}tj|�dS)Ncss"|]\}}|tjj|�fVqdS)N)rr)Zshlex_quote)�.0�key�valrrr�	<genexpr>�sz-CommandEmitterMixIn.commit.<locals>.<genexpr>zutf-8T)�shell�stdinrz+Failed to execute command '%s': returned %d)r$Zcommand_formatZstdin_formatr�dict�items�format�encode�
subprocess�Popen�PIPEZcommunicater=r.�waitr�
returncoder0r1)rZcommand_fmtZ	stdin_fmtrZ
quoted_msgZcommandZ
stdin_feedZsubprrrr5|s

zCommandEmitterMixIn.commitN)rr r!�__doc__r5rrrrr7ssr7cs(eZdZ�fdd�Z�fdd�Z�ZS)�CommandEmittercstt|�j|�||_dS)N)r#rHrr$)rr
r%)r&rrr�szCommandEmitter.__init__csdtt|�j�iS)Nr2)r#rHr)r)r&rrr�szCommandEmitter._prepare_msg)rr r!rrr6rr)r&rrH�srHcseZdZ�fdd�Z�ZS)�CommandEmailEmittercs.tt|�j�\}}|||jjdj|jj�d�S)N� )�subjectr2r*r+)r#rIrr$r*rr+)rrKr2)r&rrr�s
z CommandEmailEmitter._prepare_msg)rr r!rr6rr)r&rrI�srIc@seZdZdd�ZdS)�StdIoEmittercCs|j�}t|�dS)N)r�print)rrrrrr5�szStdIoEmitter.commitN)rr r!r5rrrrrL�srLc@seZdZdd�ZdS)�MotdEmitterc	Cs,|j�}tdd��}|j|�WdQRXdS)Nz	/etc/motd�w)r�open�write)rrZfobjrrrr5�szMotdEmitter.commitN)rr r!r5rrrrrN�srN)Z
__future__rrrZdnf.i18nrZloggingZ
dnf.pycomprr-Zemail.utilsr,rBrrrrrZ	getLoggerr0�objectrr"r7rHrIrLrNrrrr�<module>s*
$'