HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/site-packages/pysftp/__pycache__/__init__.cpython-38.pyc
U

LD�g<��@s�dZddlmZddlZddlmZddlZddlZddlm	Z	m
Z
mZddlZddl
Z
ddlZddlmZmZddlmZmZmZddlmZmZmZdd	lmZmZmZmZmZmZmZm Z d
Z!Gdd�de"�Z#Gd
d�de"�Z$dS)z!A friendly Python SFTP interface.�)�print_functionN)�contextmanager)�S_IMODE�S_ISDIR�S_ISREG)�SSHException�AuthenticationException)�AgentKey�RSAKey�DSSKey)�CredentialException�ConnectionException�HostKeysException)�st_mode_to_int�WTCallbacks�path_advance�path_retreat�reparent�walktree�cd�known_hostsz0.2.9c@s"eZdZdZddd�Zdd�ZdS)�CnOptsa�additional connection options beyond authentication

    :ivar bool|str log: initial value: False -
        log connection/handshake details? If set to True,
        pysftp creates a temporary file and logs to that.  If set to a valid
        path and filename, pysftp logs to that.  The name of the logfile can
        be found at  ``.logfile``
    :ivar bool compression: initial value: False - Enables compression on the
        transport, if set to True.
    :ivar list|None ciphers: initial value: None -
        List of ciphers to use in order.
    :ivar paramiko.hostkeys.HostKeys|None hostkeys: HostKeys object to use for
        host key checking.
    :param filepath|None knownhosts: initial value: None - file to load
        hostkeys. If not specified, uses ~/.ssh/known_hosts
    :returns: (obj) CnOpts - A connection options object, used for passing
        extended options to the Connection
    :raises HostKeysException:
    NcCs�d|_d|_d|_|dkr t�}tj��|_z|j�|�Wn@tk
r|d|}|d7}|d7}|d7}t	�
|t�YnXt|j�
��dkr�td��dS)NFz"Failed to load HostKeys from %s.  z*You will need to explicitly load HostKeys z+(cnopts.hostkeys.load(filename)) or disablez*HostKey checking (cnopts.hostkeys = None).rzNo Host Keys Found)�log�compression�ciphersr�paramiko�hostkeysZHostKeys�load�IOError�warnings�warn�UserWarning�len�itemsr)�selfZ
knownhosts�wmsg�r&�</opt/cppython/lib/python3.8/site-packages/pysftp/__init__.py�__init__.s zCnOpts.__init__cCs0|j�|�}|dkr td|��t|���dS)zkreturn the matching hostkey to use for verification for the host
        indicated or raise an SSHExceptionNzNo hostkey for host %s found.r)r�lookupr�list�values)r$�hostZkvalr&r&r'�get_hostkeyBszCnOpts.get_hostkey)N)�__name__�
__module__�__qualname__�__doc__r(r-r&r&r&r'rs
rc	@seZdZdZdrdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	e
dd��Zdsdd�Zdtdd�Z
dudd�Zdvdd�Zdwdd�Zdxdd�Zdyd d!�Zdzd#d$�Zd%d&�Zed{d'd(��Zd)d*�ZeZd|d,d-�Zd}d.d/�Zd0d1�Zd~d3d4�Zdd5d6�Zd�d7d8�Zd9d:�Zd;d<�Z d=d>�Z!d�d?d@�Z"dAdB�Z#dCdD�Z$e$Z%dEdF�Z&dGdH�Z'dIdJ�Z(dKdL�Z)dMdN�Z*d�dQdR�Z+dSdT�Z,dUdV�Z-dWdX�Z.dYdZ�Z/d�d[d\�Z0e
d]d^��Z1e
d_d`��Z2e
dadb��Z3e
dcdd��Z4e
dedf��Z5e
dgdh��Z6e6j7didh��Z6e
djdk��Z8dldm�Z9dndo�Z:dpdq�Z;dS)��
Connectiona3Connects and logs into the specified hostname.
    Arguments that are not given are guessed from the environment.

    :param str host:
        The Hostname or IP of the remote machine.
    :param str|None username: *Default: None* -
        Your username at the remote machine.
    :param str|obj|None private_key: *Default: None* -
        path to private key file(str) or paramiko.AgentKey
    :param str|None password: *Default: None* -
        Your password at the remote machine.
    :param int port: *Default: 22* -
        The SSH port of the remote machine.
    :param str|None private_key_pass: *Default: None* -
        password to use, if private_key is encrypted.
    :param list|None ciphers: *Deprecated* -
        see ``pysftp.CnOpts`` and ``cnopts`` parameter
    :param bool|str log: *Deprecated* -
        see ``pysftp.CnOpts`` and ``cnopts`` parameter
    :param None|CnOpts cnopts: *Default: None* - extra connection options
        set in a CnOpts object.
    :param str|None default_path: *Default: None* -
        set a default path upon connection.
    :returns: (obj) connection to the requested host
    :raises ConnectionException:
    :raises CredentialException:
    :raises SSHException:
    :raises AuthenticationException:
    :raises PasswordRequiredException:
    :raises HostKeysException:

    N�FcCs�||ddd�|_|	pt�|_|
|_|r>d}t�|t�||j_|dk	r^d}t�|t�||j_|jj	dk	r||j�
|�|jd<d|_d|_|�
�|��d|_|�||�|j�|jj�|�|||�|jjf|j�dS)N)�username�password�hostkey�pkeyzJlog parameter is deprecated and will be remove in 0.3.0. Use cnopts param.zNciphers parameter is deprecated and will be remove in 0.3.0. Use cnopts param.r6F)�	_tconnectr�_cnopts�
_default_pathrr �DeprecationWarningrrrr-�
_sftp_live�_sftp�
_set_username�_set_logging�
_transport�_start_transportZuse_compressionr�_set_authentication�connect)r$r,r4�private_keyr5�port�private_key_passrrZcnoptsZdefault_pathr%r&r&r'r(ns2�zConnection.__init__cCs�|dkr�|sHtj�tj�d��r&d}n"tj�tj�d��r@d}ntd��t|ttf�rb||jd<nLtj�|�}zt�	||�|jd<Wn(t
jk
r�t�	||�|jd<YnXdS)z4Authenticate the transport. prefer password if givenNz
~/.ssh/id_rsaz
~/.ssh/id_dsazNo password or key specified.r7)
�os�path�exists�
expanduserr�
isinstancer	r
r8Zfrom_private_key_filerrr)r$r5rDrFZprivate_key_filer&r&r'rB�s(��zConnection._set_authenticationc	Cs^z4t�||f�|_|jjdk	r2|jj}||j��_Wn$ttjfk
rXt	||��YnXdS)z5start the transport and set the ciphers if specified.N)
r�	Transportr@r9r�get_security_options�AttributeError�socket�gaierrorr
)r$r,rErr&r&r'rA�szConnection._start_transportcCs<|jddkr8tj�dd�|jd<|jddkr8td��dS)zzset the username for the connection. If not passed, then look to the
        environment.  Still nothing? Throw exception.r4N�LOGNAMEzNo username specified.)r8rG�environ�getr�r$r&r&r'r>�szConnection._set_usernamecCsH|jjrDt|jjt�r4t�dd�\}|j_t�|�tj	�
|jj�dS)zset logging for connectionz.txtzssh-N)r9rrK�bool�tempfile�mkstemprG�closer�utilZlog_to_file)r$Zfhndr&r&r'r?�s

zConnection._set_loggingcCs8|js4tj�|j�|_|jdk	r.|j�|j�d|_dS)zEstablish the SFTP connection.NT)r<rZ
SFTPClientZfrom_transportr@r=r:�chdirrTr&r&r'�
_sftp_connect�s

zConnection._sftp_connectcCs|��|j�d�S)zareturn the current working directory

        :returns: (str) current working directory

        �.�r[r=�	normalizerTr&r&r'�pwd�szConnection.pwdcCsZ|stj�|�d}|��|r,|j�|�}|jj|||d�|rVt�||j|j	f�dS)a*Copies a file between the remote host and the local host.

        :param str remotepath: the remote path and filename, source
        :param str localpath:
            the local path and filename to copy, destination. If not specified,
            file is copied to local current working directory
        :param callable callback:
            optional callback function (form: ``func(int, int)``) that accepts
            the bytes transferred so far and the total bytes to be transferred.
        :param bool preserve_mtime:
            *Default: False* - make the modification time(st_mtime) on the
            local file match the time on the remote. (st_atime can differ
            because stat'ing the localfile can/does update it's st_atime)

        :returns: None

        :raises: IOError

        ���callbackN)
rGrH�splitr[r=�statrS�utime�st_atime�st_mtime)r$�
remotepath�	localpathrb�preserve_mtime�	sftpattrsr&r&r'rS�szConnection.getc	CsZ|��|�|��>|j�d�D]*}t|j�r |j}|j|t||�|d�q W5QRXdS)alget the contents of remotedir and write to locadir. (non-recursive)

        :param str remotedir: the remote directory to copy from (source)
        :param str localdir: the local directory to copy to (target)
        :param bool preserve_mtime: *Default: False* -
            preserve modification time on files

        :returns: None

        :raises:
        r\�rjN)	r[rr=�listdir_attrr�st_mode�filenamerSr)r$�	remotedir�localdirrjZsattr�rnamer&r&r'�get_d�s
�zConnection.get_dc

Cs�|��t�}|�||j|j|j�|jD]J}t|�D]<}z"t�	t
||��|j|g|_Wq6tk
rpYq6Xq6q*|jD]r}tj
�|�\}}	||jkr�t|�D]4}||jkr�|dkr�t�	t
||��|j|g|_q�|j|t
||�|d�q|dS)aHrecursively copy remotedir structure to localdir

        :param str remotedir: the remote directory to copy from
        :param str localdir: the local directory to copy to
        :param bool preserve_mtime: *Default: False* -
            preserve modification time on files

        :returns: None

        :raises:

        r\rlN)r[rr�file_cb�dir_cb�unk_cb�dlistrrG�mkdirr�OSError�flistrHrcrS)
r$rprqrj�wtcb�dname�subdir�fname�head�_r&r&r'�get_rs*




�zConnection.get_rcCs|��|jj|||d�S)a(Copy a remote file (remotepath) to a file-like object, flo.

        :param str remotepath: the remote path and filename, source
        :param flo: open file like object to write, destination.
        :param callable callback:
            optional callback function (form: ``func(int, int``)) that accepts
            the bytes transferred so far and the total bytes to be transferred.

        :returns: (int) the number of bytes written to the opened file object

        :raises: Any exception raised by operations will be passed through.

        ra)r[r=�getfo)r$rh�florbr&r&r'r�9szConnection.getfoTc	Csl|stj�|�d}|��|r6t�|�}|j|jf}|jj||||d�}|rh|j�	||�|j�|�}|S)a�Copies a file between the local host and the remote host.

        :param str localpath: the local path and filename
        :param str remotepath:
            the remote path, else the remote :attr:`.pwd` and filename is used.
        :param callable callback:
            optional callback function (form: ``func(int, int``)) that accepts
            the bytes transferred so far and the total bytes to be transferred.
        :param bool confirm:
            whether to do a stat() on the file afterwards to confirm the file
            size
        :param bool preserve_mtime:
            *Default: False* - make the modification time(st_mtime) on the
            remote file match the time on the local. (st_atime can differ
            because stat'ing the localfile can/does update it's st_atime)

        :returns:
            (obj) SFTPAttributes containing attributes about the given file

        :raises IOError: if remotepath doesn't exist
        :raises OSError: if localpath doesn't exist

        r`)rb�confirm)
rGrHrcr[rdrfrgr=�putre)	r$rirhrbr�rjZ
local_stat�timesrkr&r&r'r�Js
�zConnection.putc
Cs||��t�}t��}t�|�td|j|j|jdd�|j	D].}tj
�||�}t||�}	|j
||	||d�q>t�|�dS)a�Copies a local directory's contents to a remotepath

        :param str localpath: the local path to copy (source)
        :param str remotepath:
            the remote path to copy to (target)
        :param bool confirm:
            whether to do a stat() on the file afterwards to confirm the file
            size
        :param bool preserve_mtime:
            *Default: False* - make the modification time(st_mtime) on the
            remote file match the time on the local. (st_atime can differ
            because stat'ing the localfile can/does update it's st_atime)

        :returns: None

        :raises IOError: if remotepath doesn't exist
        :raises OSError: if localpath doesn't exist
        r\F)�recurse�r�rjN)r[rrG�getcwdrZrrtrurvrzrH�joinrr�)
r$rirhr�rjr{�
cur_local_dirr~�src�destr&r&r'�put_dss
�

zConnection.put_dcCs|��t�}t��}t�|�td|j|j|j�t�|�|j	D]*}|dkrDt
||�}|�|�sD|�|�qD|j
D]�}	tj�|	�\}
}|
|j	kr�t|
�D]4}||j	kr�|dkr�|�t
||��|j	|g|_	q�tj�||	�}
t
||	�}|j|
|||d�qvdS)a�Recursively copies a local directory's contents to a remotepath

        :param str localpath: the local path to copy (source)
        :param str remotepath:
            the remote path to copy to (target)
        :param bool confirm:
            whether to do a stat() on the file afterwards to confirm the file
            size
        :param bool preserve_mtime:
            *Default: False* - make the modification time(st_mtime) on the
            remote file match the time on the local. (st_atime can differ
            because stat'ing the localfile can/does update it's st_atime)

        :returns: None

        :raises IOError: if remotepath doesn't exist
        :raises OSError: if localpath doesn't exist
        r\r�N)r[rrGr�rZrrtrurvrwr�isdirrxrzrHrcrr�r�)r$rirhr�rjr{r�r|�pthr~rr�r}r�r�r&r&r'�put_r�s*







zConnection.put_rrcCs|��|jj|||||d�S)a2Copies the contents of a file like object to remotepath.

        :param flo: a file-like object that supports .read()
        :param str remotepath: the remote path.
        :param int file_size:
            the size of flo, if not given the second param passed to the
            callback function will always be 0.
        :param callable callback:
            optional callback function (form: ``func(int, int``)) that accepts
            the bytes transferred so far and the total bytes to be transferred.
        :param bool confirm:
            whether to do a stat() on the file afterwards to confirm the file
            size

        :returns:
            (obj) SFTPAttributes containing attributes about the given file

        :raises: TypeError, if remotepath not specified, any underlying error

        )�	file_sizerbr�)r[r=�putfo)r$r�rhr�rbr�r&r&r'r��s
�zConnection.putfocCs@|j��}|�|�|�dd���}|r,|S|�dd���SdS)aMExecute the given commands on a remote machine.  The command is
        executed without regard to the remote :attr:`.pwd`.

        :param str command: the command to execute.

        :returns: (list of str) representing the results of the command

        :raises: Any exception raised by command will be passed through.

        �rb���N)r@Zopen_sessionZexec_command�makefile�	readlinesZmakefile_stderr)r$�command�channel�outputr&r&r'�execute�s

zConnection.executec	cs4|j}z|dk	r|�|�dVW5|�|�XdS)aCcontext manager that can change to a optionally specified remote
        directory and restores the old pwd on exit.

        :param str|None remotepath: *Default: None* -
            remotepath to temporarily make the current directory
        :returns: None
        :raises: IOError, if remote path doesn't exist
        N)r_�cwd)r$rhZ
original_pathr&r&r'r�s


z
Connection.cdcCs|��|j�|�dS)z�change the current working directory on the remote

        :param str remotepath: the remote path to change to

        :returns: None

        :raises: IOError, if path does not exist

        N)r[r=rZ�r$rhr&r&r'rZs
zConnection.chdir�	cCs&|��|jj|tt|�d�d�dS)ajset the mode of a remotepath to mode, where mode is an integer
        representation of the octal mode to use.

        :param str remotepath: the remote path/file to modify
        :param int mode: *Default: 777* -
            int representation of octal mode for directory

        :returns: None

        :raises: IOError, if the file doesn't exist

        ���modeN)r[r=�chmod�int�str�r$rhr�r&r&r'r�s
zConnection.chmodcCsj|��|dks|dkrT|dkr,|dkr,dS|j�|�}|dkrF|j}|dkrT|j}|jj|||d�dS)a set uid and/or gid on a remotepath, you may specify either or both.
        Unless you have **permission** to do this on the remote server, you
        will raise an IOError: 13 - permission denied

        :param str remotepath: the remote path/file to modify
        :param int uid: the user id to set on the remotepath
        :param int gid: the group id to set on the remotepath

        :returns: None

        :raises:
            IOError, if you don't have permission or the file doesn't exist

        N)�uid�gid)r[r=rd�st_uid�st_gid�chown)r$rhr�r�Zrstatr&r&r'r� szConnection.chowncCs|��|j��S)z�return the current working directory on the remote. This is a wrapper
        for paramiko's method and not to be confused with the SFTP command,
        cwd.

        :returns: (str) the current remote path. None, if not set.

        )r[r=r�rTr&r&r'r�;szConnection.getcwdr\cCs|��t|j�|��S)z�return a list of files/directories for the given remote path.
        Unlike, paramiko, the directory listing is sorted.

        :param str remotepath: path to list on the server

        :returns: (list of str) directory entries, sorted

        )r[�sortedr=�listdirr�r&r&r'r�Fs	zConnection.listdircCs |��t|j�|�dd�d�S)a6return a list of SFTPAttribute objects of the files/directories for
        the given remote path. The list is in arbitrary order. It does not
        include the special entries '.' and '..'.

        The returned SFTPAttributes objects will each have an additional field:
        longname, which may contain a formatted string of the file's
        attributes, in unix format. The content of this string will depend on
        the SFTP server.

        :param str remotepath: path to list on the server

        :returns: (list of SFTPAttributes), sorted

        cSs|jS�N)ro)�attrr&r&r'�<lambda>c�z)Connection.listdir_attr.<locals>.<lambda>)�key)r[r�r=rmr�r&r&r'rmRs�zConnection.listdir_attrcCs&|��|jj|tt|�d�d�dS)a[Create a directory named remotepath with mode. On some systems,
        mode is ignored. Where it is used, the current umask value is first
        masked out.

        :param str remotepath: directory to create`
        :param int mode: *Default: 777* -
            int representation of octal mode for directory

        :returns: None

        r�r�N)r[r=rxr�r�r�r&r&r'rxeszConnection.mkdircCs|��|j�|�S)a�Return the expanded path, w.r.t the server, of a given path.  This
        can be used to resolve symlinks or determine what the server believes
        to be the :attr:`.pwd`, by passing '.' as remotepath.

        :param str remotepath: path to be normalized

        :return: (str) normalized form of the given path

        :raises: IOError, if remotepath can't be resolved
        r]r�r&r&r'r^tszConnection.normalizecCs<|��zt|j�|�j�}Wntk
r6d}YnX|S)z~return true, if remotepath is a directory

        :param str remotepath: the path to test

        :returns: (bool)

        F)r[rr=rdrnr�r$rh�resultr&r&r'r��s
zConnection.isdircCs<|��zt|j�|�j�}Wntk
r6d}YnX|S)zxreturn true if remotepath is a file

        :param str remotepath: the path to test

        :returns: (bool)

        F)r[rr=rdrnrr�r&r&r'�isfile�s
zConnection.isfilecCsl|��|�|�rnT|�|�r,td|��n<tj�|�\}}|rV|�|�sV|�||�|rh|j||d�dS)a�create all directories in remotedir as needed, setting their mode
        to mode, if created.

        If remotedir already exists, silently complete. If a regular file is
        in the way, raise an exception.

        :param str remotedir: the directory structure to create
        :param int mode: *Default: 777* -
            int representation of octal mode for directory

        :returns: None

        :raises: OSError

        zAa file with the same name as the remotedir, '%s', already exists.r�N)	r[r�r�ryrGrHrc�makedirsrx)r$rpr�r�tailr&r&r'r��s

�zConnection.makedirscCs|��|j�|j�|��S)z�Return the target of a symlink (shortcut).  The result will be
        an absolute pathname.

        :param str remotelink: remote path of the symlink

        :return: (str) absolute path to target

        )r[r=r^�readlink)r$Z
remotelinkr&r&r'r��s	zConnection.readlinkcCs|��|j�|�dS)aremove the file @ remotefile, remotefile may include a path, if no
        path, then :attr:`.pwd` is used.  This method only works on files

        :param str remotefile: the remote file to delete

        :returns: None

        :raises: IOError

        N)r[r=�remove)r$Z
remotefiler&r&r'r��szConnection.removecCs|��|j�|�dS)zxremove remote directory

        :param str remotepath: the remote directory to remove

        :returns: None

        N)r[r=�rmdirr�r&r&r'r��szConnection.rmdircCs|��|j�||�dS)z�rename a file or directory on the remote host.

        :param str remote_src: the remote file/directory to rename

        :param str remote_dest: the remote file/directory to put it

        :returns: None

        :raises: IOError

        N)r[r=�rename�r$Z
remote_srcZremote_destr&r&r'r��szConnection.renamecCs|��|j�|�S)z�return information about file/directory for the given remote path

        :param str remotepath: path to stat

        :returns: (obj) SFTPAttributes

        )r[r=rdr�r&r&r'rd�szConnection.statcCs|��|j�|�S)z�return information about file/directory for the given remote path,
        without following symbolic links. Otherwise, the same as .stat()

        :param str remotepath: path to stat

        :returns: (obj) SFTPAttributes object

        )r[r=�lstatr�r&r&r'r�s	zConnection.lstatcCsT|jr|j��d|_|jr,|j��d|_|jjrPddl}|�d�}|rPg|_dS)z$Closes the connection and cleans up.FNrr)	r<r=rXr@r9r�logging�	getLogger�handlers)r$r�Zlgrr&r&r'rX
s


zConnection.close�rr�cCs|��|jj|||d�S)a�Open a file on the remote server.

        See http://paramiko-docs.readthedocs.org/en/latest/api/sftp.html for
        details.

        :param str remote_file: name of the file to open.
        :param str mode:
            mode (Python-style) to open file (always assumed binary)
        :param int bufsize: *Default: -1* - desired buffering

        :returns: (obj) SFTPFile, a handle the remote open file

        :raises: IOError, if the file could not be opened.

        )r��bufsize)r[r=�open)r$Zremote_filer�r�r&r&r'r� szConnection.opencCs4|��z|j�|�Wntk
r.YdSXdS)z�Test whether a remotepath exists.

        :param str remotepath: the remote path to verify

        :returns: (bool) True, if remotepath exists, else False

        FT)r[r=rdrr�r&r&r'rI3szConnection.existscCs4|��z|j�|�Wntk
r.YdSXdS)z�Test whether a remotepath exists.  Returns True for broken symbolic
        links

        :param str remotepath: the remote path to verify

        :returns: (bool), True, if lexists, else False

        FT)r[r=r�rr�r&r&r'�lexistsBs	zConnection.lexistscCs|��|j�||�dS)a7create a symlink for a remote file on the server

        :param str remote_src: path of original file
        :param str remote_dest: path of the created symlink

        :returns: None

        :raises:
            any underlying error, IOError if something already exists at
            remote_dest

        N)r[r=�symlinkr�r&r&r'r�Rs
zConnection.symlinkcCs$|��|j�||�|j�|�jS)a�Change the size of the file specified by path. Used to modify the
        size of the file, just like the truncate method on Python file objects.
        The new file size is confirmed and returned.

        :param str remotepath: remote file path to modify
        :param int|long size: the new file size

        :returns: (int) new size of file

        :raises: IOError, if file does not exist

        )r[r=�truncaterd�st_size)r$rh�sizer&r&r'r�bs
zConnection.truncatec	Csv|��|�|�D]^}t�||�}|j�|�j}t|�rV||�|rp|�||||�qt	|�rh||�q||�qdS)a#recursively descend, depth first, the directory tree rooted at
        remotepath, calling discreet callback functions for each regular file,
        directory and unknown file type.

        :param str remotepath:
            root of remote directory to descend, use '.' to start at
            :attr:`.pwd`
        :param callable fcallback:
            callback function to invoke for a regular file.
            (form: ``func(str)``)
        :param callable dcallback:
            callback function to invoke for a directory. (form: ``func(str)``)
        :param callable ucallback:
            callback function to invoke for an unknown file type.
            (form: ``func(str)``)
        :param bool recurse: *Default: True* - should it recurse

        :returns: None

        :raises:

        N)
r[r��	posixpathr�r=rdrnrrr)	r$rhZ	fcallbackZ	dcallbackZ	ucallbackr��entry�pathnamer�r&r&r'rss
zConnection.walktreecCs|��|jS)z�give access to the underlying, connected paramiko SFTPClient object

        see http://paramiko-docs.readthedocs.org/en/latest/api/sftp.html

        :params: None

        :returns: (obj) the active SFTPClient object

        )r[r=rTr&r&r'�sftp_client�szConnection.sftp_clientcCs|jj|jjfS)z�Get tuple of currently used local and remote ciphers.

        :returns:
            (tuple of  str) currently used ciphers (local_cipher,
            remote_cipher)

        )r@Zlocal_cipherZ
remote_cipherrTr&r&r'�active_ciphers�s	zConnection.active_cipherscCs|jj}|jj}||fS)z�Get tuple of currently used local and remote compression.

        :returns:
            (tuple of  str) currently used compression (local_compression,
            remote_compression)

        )r@Zlocal_compressionZremote_compression)r$ZlocalcZremotecr&r&r'�active_compression�s	zConnection.active_compressioncCs
|j��S)a7return the available security options recognized by paramiko.

        :returns:
            (obj) security preferences of the ssh transport. These are tuples
            of acceptable `.ciphers`, `.digests`, `.key_types`, and key
            exchange algorithms `.kex`, listed in order of preference.

        )r@rMrTr&r&r'�security_options�szConnection.security_optionscCs|jjS)z~return the name of the file used for logging or False it not logging

        :returns: (str)logfile or (bool) False

        )r9rrTr&r&r'�logfile�szConnection.logfilecCs|��|j��}|��S)a& (float|None) *Default: None* -
            get or set the underlying socket timeout for pending read/write
            ops.

        :returns:
            (float|None) seconds to wait for a pending read/write operation
            before raising socket.timeout, or None for no timeout
        )r[r=�get_channel�
gettimeout)r$r�r&r&r'�timeout�s

zConnection.timeoutcCs |��|j��}|�|�dS)zsetter for timeoutN)r[r=r��
settimeout)r$�valr�r&r&r'r��s
cCs
|j��S)zreturn the remote server's key)r@Zget_remote_server_keyrTr&r&r'�remote_server_key�szConnection.remote_server_keycCs|��dS)z-Attempt to clean up if not explicitly closed.N�rXrTr&r&r'�__del__�szConnection.__del__cCs|Sr�r&rTr&r&r'�	__enter__�szConnection.__enter__cCs|��dSr�r�)r$�etype�value�	tracebackr&r&r'�__exit__�szConnection.__exit__)	NNNr3NNFNN)NNF)F)F)N)NNTF)TF)TF)NrNT)N)r�)NN)r\)r\)r�)r�)r�r�)T)<r.r/r0r1r(rBrAr>r?r[�propertyr_rSrsr�r�r�r�r�r�r�rrrZr�r�r�r�r�rmrxr^r�r�r�r�r��unlinkr�r�rdr�rXr�rIr�r�r�rr�r�r�r�r�r��setterr�r�r�r�r&r&r&r'r2Ls�!�
#		
	�
 

(
�
)
"
,�







 
�
)









r2)%r1�
__future__rrG�
contextlibrr�rOrdrrrrVrrrrr	r
rZpysftp.exceptionsrr
rZpysftp.helpersrrrrrrrr�__version__�objectrr2r&r&r&r'�<module>s (2