HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/ansible/plugins/action/__pycache__/pause.cpython-39.pyc
a

�)g:-�
@szddlmZmZmZeZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
mZmZddlmZddlmZmZddlmZddlmZddlmZe�ZzFddlZddlZze��d	ZWn ej e!ej"fy�d
ZYn0Wne#y�d
ZYn0dZ$dZ%e�r.e�&d
��pe$Z$e�&d��p,e%Z%e	j'fdd�Z(Gdd�de)�Z*dd�Z+dd�Z,ddd�Z-Gdd�de�Z.dS)�)�absolute_import�division�print_functionN)�getpgrp�isatty�	tcgetpgrp)�AnsibleError)�to_text�	to_native)�boolean)�
ActionBase)�DisplayTF�
sZcr�elcCs�t�|�}|tjtjtjBtjBtjBtjB@|tj<|tj	tj
tjB@|tj	<|tj	tjB|tj	<|tj
tjtjBtjBtjB@|tj
<d|tjtj<d|tjtj<t�|||�dS)aPut terminal into a raw mode.

    Copied from ``tty`` from CPython 3.11.0, and modified to not remove OPOST from OFLAG

    OPOST is kept to prevent an issue with multi line prompts from being corrupted now that display
    is proxied via the queue from forks. The problem is a race condition, in that we proxy the display
    over the fork, but before it can be displayed, this plugin will have continued executing, potentially
    setting stdout and stdin to raw which remove output post processing that commonly converts NL to CRLF
    �rN)�termios�	tcgetattr�ttyZIFLAGZBRKINTZICRNLZINPCKZISTRIPZIXONZCFLAGZCSIZEZPARENBZCS8ZLFLAG�ECHOZICANONZIEXTENZISIGZCCZVMINZVTIME�	tcsetattr)�fdZwhen�mode�r�@/usr/lib/python3.9/site-packages/ansible/plugins/action/pause.py�setraw=s

0*rc@seZdZdS)�AnsibleTimeoutExceededN)�__name__�
__module__�__qualname__rrrrrRsrcCst�dS)N)r)Zsignum�framerrr�timeout_handlerVsr cCs |�dt�|�dt�dS)Ns[%s)�write�MOVE_TO_BOL�CLEAR_TO_EOL)�stdoutrrr�
clear_lineZsr%cCs*|durdSt|�r"t�t|�kSdSdS)NF)rrr)rrrr�is_interactive_s
r&cs.eZdZdZdZd�fdd�	Zdd�Z�ZS)	�ActionModulezC pauses execution for a length or time, or until input is received TNcs4|durt�}tt|��||�}~|jddd�dtidtiddid�dd	�\}}d
}d}d}|d}	d}
|�td
dddddd|	d��|	s�d}
|dr�d|j���	�|d|
f}nd|j���	�d|
f}|d
dur�|d
d}n|ddur�|d}d}t
�
�}ttj�
��|d<d|d<d}d}
�zh�z�|du�r�|dk�rHd}t�tjt�t�|�t�d||
f�t�d�f|d�r�t�|�n
t�|�d}d}z&|jjj}tjj}|��}|��}Wnttf�y�d}Yn0t|�}|�r�zt�|�dtj}Wnt�y(d}Yn0zt�|�dtj }Wnt�y^ddg}Yn0t�|�}
t!|�t"|��r�t!|�|�s�|	�r�t�|�}|d tj#B|d <t�$|tj%|�t�&|tj'�|�s|du�r�t�(d!�|du�r�t
�)|d��q�z�|�*d�}||k�r"t+|�t,�|�s�|d"v�rBt+|�W�q�nT||v�r�|ddd#�|d<t+|�|	�r||�-|d�|�.�n|d|7<WnTt,�y�t�d�t�d$�f|�/|��r�t+|�Y�q�t+|�t0d%��Yn0�q�Wnt1�yYn0Wd||
fv�r4t"|��r4t�$|tj2|
�t
�
�|}ttj�
��|d&<t|�|d'<|d
k�rxt3|d(d)�}n
t3|d)�}d*||f|d+<n�d||
fv�r�t"|��r�t�$|tj2|
�t
�
�|}ttj�
��|d&<t|�|d'<|d
k�rt3|d(d)�}n
t3|d)�}d*||f|d+<0t|dd,d-�|d<|S).z run the pause action module N�boolT)�type�defaultr)�str)�echo�minutes�seconds�prompt))r-r.)Z
argument_specZmutually_exclusiver-r,�Fr)Zchanged�rc�stderrr$�start�stop�deltar,z (output is hidden)r/z
[%s]
%s%s:z,Press enter to continue, Ctrl+C to interrupt�<r.r3�Z
user_inputrzPausing for %d seconds%sz<(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
�����z>Not waiting for response to prompt as stdin is not interactive)r�
���z0Press 'C' to continue the play or 'A' to abort 
zuser requested abort!r4r5gN@�zPaused for %s %sr$Zsurrogate_or_strict)�errors)4�dict�superr'�runZvalidate_argument_spec�int�updateZ_taskZget_name�strip�timer	�datetimeZnow�signal�SIGALRMr �alarm�displayZ_connectionZ
_new_stdin�buffer�sysr$�fileno�
ValueError�AttributeErrorr&rrZVINTR�	ExceptionZVERASErrrrZTCSANOWZtcflushZTCIFLUSHZwarning�sleep�readr%�KeyboardInterruptr!�flush�_c_or_arrZ	TCSADRAIN�round)�self�tmpZ	task_vars�resultZvalidation_resultZnew_module_argsZ
duration_unitr/r.r,Zecho_promptr3Zstdin_fdZold_settingsZ	stdout_fd�stdinr$�interactiveZintrZ	backspaceZnew_settings�key_pressedZduration��	__class__rrrCqs
��
�





















�

zActionModule.runcCs0|�d�}|��dkrdS|��dkrdSqdS)Nr�aF�cT)rT�lower)rYr\r^rrrrW1s

zActionModule._c_or_a)NN)rrr�__doc__ZBYPASS_HOST_LOOPrCrW�
__classcell__rrr_rr'ls
Ar')N)/Z
__future__rrrr)Z
__metaclass__rHrIrNrrGr�osrrrZansible.errorsrZansible.module_utils._textr	r
Z)ansible.module_utils.parsing.convert_boolrZansible.plugins.actionrZansible.utils.displayr
rLZcurses�ioZ	setuptermZ
HAS_CURSES�error�	TypeError�UnsupportedOperation�ImportErrorr"r#ZtigetstrZ	TCSAFLUSHrrRrr r%r&r'rrrr�<module>sF