%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/
Upload File :
Create Path :
Current File : //opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/proxy.pyc

�
��Abc@s�ddlZddlZddlZddlmZddlZddlZd\ZZyddlZWne	k
r�Z
e
ZnXddlmZddl
mZdefd��YZdS(i����N(tselect(tProxyCommandFailure(tClosingContextManagertProxyCommandcBsYeZdZd�Zd�Zd�Zd�Zed��Zed��Z	d�Z
RS(s�
    Wraps a subprocess running ProxyCommand-driven programs.

    This class implements a the socket-like interface needed by the
    `.Transport` and `.Packetizer` classes. Using this class instead of a
    regular socket makes it possible to talk with a Popen'd command that will
    proxy traffic between the client and a server hosted in another machine.

    Instances of this class may be used as context managers.
    c
Csjtdkrt�ntj|�|_tj|jdtjdtjdtjdd�|_d|_	dS(s
        Create a new CommandProxy instance. The instance created by this
        class can be passed as an argument to the `.Transport` class.

        :param str command_line:
            the command that should be executed and used as the proxy.
        tstdintstdouttstderrtbufsizeiN(
t
subprocesstNonetsubprocess_import_errortshlextsplittcmdtPopentPIPEtprocessttimeout(tselftcommand_line((sC/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/proxy.pyt__init__3s					cCsUy|jjj|�Wn1tk
rJ}tdj|j�|j��nXt|�S(s�
        Write the content received from the SSH client to the standard
        input of the forked command.

        :param str content: string to be sent to the forked command
        t (	RRtwritetIOErrorRtjoinR
tstrerrortlen(Rtcontentte((sC/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/proxy.pytsendGs
"c
CsPy�d}tj�}x�t|�|kr�d}|jdk	r}tj�|}||jkrmtj��n|j|}nt|jjggg|�\}}}|r|d|jjkr|tj	|jjj
�|t|��7}qqW|SWnQtjk
r|r|S�n1tk
rK}	tdj
|j�|	j��nXdS(s�
        Read from the standard output of the forked program.

        :param int size: how many chars should be read

        :return: the string of bytes read, which may be shorter than requested
        tiRN(ttimeRR	RtsocketRRRtostreadtfilenoRRRR
R(
Rtsizetbuffertstarttselect_timeouttelapsedtrtwtxR((sC/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/proxy.pytrecvXs*'	*cCstj|jjtj�dS(N(R!tkillRtpidtsignaltSIGTERM(R((sC/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/proxy.pytcloseyscCs|jjdk	S(N(Rt
returncodeR	(R((sC/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/proxy.pytclosed|scCs|jS(N(R3(R((sC/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/proxy.pyt_closed�scCs
||_dS(N(R(RR((sC/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/proxy.pyt
settimeout�s(t__name__t
__module__t__doc__RRR,R1tpropertyR3R4R5(((sC/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/proxy.pyR's
			!	(NN(R!RR/RR RR	RR
tImportErrorRtparamiko.ssh_exceptionRt
paramiko.utilRR(((sC/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/proxy.pyt<module>s


Zerion Mini Shell 1.0