MOON
Server: Apache
System: Linux server2.shieldcogroup.com 3.10.0-1160.119.1.el7.tuxcare.els12.x86_64 #1 SMP Fri Nov 8 05:49:38 UTC 2024 x86_64
User: jacom (1029)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python2.7/site-packages/leapp/libraries/stdlib/call.pyo
�
g��fc@s�ddlmZddlZddlZddlZddlZyddlmZWn!ek
rwddl	m
ZnXddlmZddl
mZmZmZmZmZdZdZd	Zd
dddd�Zd
�d
�d
ddddd�ZdS(i����(tprint_functionN(twhich(tfind_executable(tstring_types(tPOLL_HUPtPOLL_INtPOLL_OUTtPOLL_PRIt	EventLoopiiisutf-8iPcs�x"�D]}|j|ttB�qW|rB|j|dt�nd}	t�}
t��|rfdnd}d��D�}�r�d��D�}
�fd��D�}n�fd�}x�|jr}t|
�|kr}|j|�}x�|D]�\}}|tkr%|
j	|�|j
|�n|ttB@dkr�||�}tj||�}|||f|��r�|
|c||j
|�7<xPd|
|kr�|
|jdd�\}}||
|<|||f|�q�Wn||c|7<q�|tkr�|\}}||
krq�n|	tj|||	�7}	|	t|�krv|
j	|�|j
|�tj|�qvq�q�Wq�W�r�x?|
j�D].\}}|r�||||�f|�q�q�Wn|S(NiicSsi|]}t�|�qS((tbytes(t.0tfd((s?/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/call.pys
<dictcomp>-s	cSsi|]}d|�qS(t((R
R((s?/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/call.pys
<dictcomp>/s	cs%i|]}tj���|�qS((tcodecstgetincrementaldecoder(R
R(tencoding(s?/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/call.pys
<dictcomp>0s	cs�j|�dS(s�
        File descriptors passed via `read_fds` are always representing [stdout, stderr],
        since arrays start at index 0, we need to add 1 to get the real symbolic value
        `STDOUT` or `STDERR`.
        i(tindex(R(tread_fds(s?/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/call.pyt_get_fd_type2ss
(tregisterRRRtsettlentclosedtpollRtaddt
unregistertostreadtdecodetsplittwritetclosetitems(tepRtcallback_rawtcallback_linebufferedRRttimeouttbuffer_sizeRtoffsetthuppedtnum_expectedtbuftlinebufstdecodersRteventsteventtfd_typeRtpretposttwfdtdatatlb((RRs?/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/call.pyt
_multiplexsV
	



#cCsdS(N(tNone(Rtvalue((s?/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/call.pyt<lambda>bscCs�t|ttf�s$td��nt|�sUt|dd�rd|jjdkrdtd��nt|�s�t|dd�r�|jjdkr�td��nt|t	�s�t|t
�s�|dkr�td��nt|t	�s	t|t
�s	|dkrtd��ntj
j�}|r[t|t�sKtd	��n|j|�n|jd
d�}	t|dd|	�s�ttjtjtj�|d��ntj�\}
}tj�\}}
d\}}tt}}t|t	�rt}nTt|t�r*t}tj�\}}n*|dk	rTtdjt|����ntj�}|dkr�t�}tj|�tj|
�i}|r�||j |�f|d
<tj|�nt!||
|g||d|d|d||�}tj"�\}}|j�tj|
�tj|�|d@|d?d@}}i|d6|d6|d6}|s�|ji||
d6||d6�n5|ji||
j#|�d6||j#|�d6�|S|dkr�|r�tj$|t%�n|rtj|�tj$|t%�ntj|
�tj|�tj$|t&�tj$|
t'�ytj(|d|d|�Wq�tk
r�}t)j*j+dj|dt,|���tj-d�q�XndS(s�
        :param command: The command to execute
        :type command: list, tuple
        :param encoding: Decode output or encode input using this encoding
        :type encoding: str
        :param poll_timeout: Timeout used by epoll to wait certain amount of time for activity on file descriptors
        :type poll_timeout: int
        :param read_buffer_size: How much data are we going to read from the file descriptors each iteration.
                                 The default value of 80 chosen to correspond with suggested terminal line width
        :type read_buffer_size: int
        :param callback_raw: Callback executed on raw data (before decoding) as they are read from file descriptors
        :type callback_raw: ((fd: int, fd_type: int), buffer: bytes) -> None
        :param callback_linebuffered: Callback executed on decoded lines as they are read from the file descriptors
        :type callback_linebuffered: ((fd: int, fd_type: int), value: str) -> None
        :param stdin: String or a file descriptor that will be written to stdin of the child process
        :type stdin: int, str
        :param env: Environment variables to use for execution of the command
        :type env: dict
        :return: {'stdout' : stdout, 'stderr': stderr, 'signal': signal, 'exit_code': exit_code, 'pid': pid}
        :rtype: dict
        :raises: OSError if an executable is missing or has wrong permissions
        :raises: CalledProcessError if the cmd has non-zero exit code and `checked` is False
        :raises: TypeError if any input parameters have an invalid type
        :raises: valueError if any of input parameters have an invalid value
    s+command parameter has to be a list or tuplet__code__is@callback_raw parameter has to be callable accepting 2 parameterssIcallback_linebuffered parameter has to be callable accepting 2 parametersis:poll_timeout parameter has to be integer greater than zeros>read_buffer_size parameter has to be integer greater than zeros$env parameter has to be a dictionarytPATHtpaths>stdin has to be either a file descriptor or string, not "{!s}"RR$R%Ri�itsignalt	exit_codetpidtstdouttstderrtenvsError: Cannot execute {}: {}
iN(NN(.t
isinstancetlistttuplet	TypeErrortcallabletgetattrR5R8tco_argcounttinttboolt
ValueErrorRtenvirontcopytdicttupdatetgetRtOSErrorterrnotENOENTtstrerrortpipetFalsetTrueRtformatttypetforkRRtencodeR4twaitRtdup2tSTDINtSTDOUTtSTDERRtexecvpetsysR?Rtstrt_exit(tcommandR"R#Rtpoll_timeouttread_buffer_sizetstdinR@RKt_pathR>twstdoutR?twstderrtfstdintwstdintstdin_fdt	stdin_strR=R!textraRtstatusR;R<trette((s?/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/call.pyt_callbs�
$++(	
		

		


		


&(t
__future__RR
RQRRatshutilRtImportErrortdistutils.spawnRtleapp.compatRt leapp.libraries.stdlib.eventloopRRRRRR]R^R_R5R4Rs(((s?/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/call.pyt<module>s 
(I