Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / paramiko / sftp_client.pyc
Size: Mime:
ó
°‹EYc@sddlmZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZddlmZmZmZmZddlmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6dd	l7m8Z8dd
l9m:Z:ddl;m<Z<ddl=m>Z>d
„Z?dZ@dee>fd„ƒYZAdeAfd„ƒYZBdS(iÿÿÿÿ(thexlifyN(tutil(tChannel(tMessage(tINFOtDEBUGto777(t
bytestringtbtutlong(tBaseSFTPtCMD_OPENDIRt
CMD_HANDLEt	SFTPErrortCMD_READDIRtCMD_NAMEt	CMD_CLOSEtSFTP_FLAG_READtSFTP_FLAG_WRITEtSFTP_FLAG_CREATEtSFTP_FLAG_TRUNCtSFTP_FLAG_APPENDtSFTP_FLAG_EXCLtCMD_OPENt
CMD_REMOVEt
CMD_RENAMEt	CMD_MKDIRt	CMD_RMDIRtCMD_STATt	CMD_ATTRSt	CMD_LSTATtCMD_SYMLINKtCMD_SETSTATtCMD_READLINKtCMD_REALPATHt
CMD_STATUStCMD_EXTENDEDtSFTP_OKtSFTP_EOFtSFTP_NO_SUCH_FILEtSFTP_PERMISSION_DENIED(tSFTPAttributes(tSSHException(tSFTPFile(tClosingContextManagercCsUy|jdƒSWn=ttfk
rPy|jdƒSWqQtk
rL|SXnXdS(sÑ
    decode a string as ascii or utf8 if possible (as required by the sftp
    protocol).  if neither works, just return a byte string because the server
    probably doesn't know the filename's encoding.
    tasciisutf-8N(tencodetUnicodeErrortAttributeErrortdecode(ts((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyt_to_unicode/s
t/t
SFTPClientcBsšeZdZd„Zed*d*d„ƒZd„Zd„Zd„Z	dd„Z
dd„Zdd	d
„Zddd
„Z
e
Zd„ZeZd„Zd„Zed„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd*d„Zd„Z d„Z!dd*e"d „Z#d*e"d!„Z$d*d"„Z%d*d#„Z&d$„Z'd%„Z(d*d&„Z)d'„Z*d(„Z+d)„Z,RS(+sÅ
    SFTP client object.

    Used to open an SFTP session across an open SSH `.Transport` and perform
    remote file operations.

    Instances of this class may be used as context managers.
    cCsætj|ƒ||_t|_d|_tjƒ|_d|_
tjƒ|_
t|ƒtkrž|jjƒ}tj|jƒdƒ|_|jƒ|_ny|jƒ}Wntk
rÍtdƒ‚nX|jtd|ƒdS(s£
        Create an SFTP client from an existing `.Channel`.  The channel
        should already have requested the ``"sftp"`` subsystem.

        An alternate way to create an SFTP client context is by using
        `from_transport`.

        :param .Channel sock: an open `.Channel` using the ``"sftp"`` subsystem

        :raises:
            `.SSHException` -- if there's an exception while negotiating sftp
        is.sftpsEOF during negotiations*Opened sftp connection (server version %d)N(Rt__init__tsocktFalsetultra_debugtrequest_numbert	threadingtLockt_locktNonet_cwdtweakreftWeakValueDictionaryt
_expectingttypeRt
get_transportRt
get_loggertget_log_channeltloggertget_hexdumpt
_send_versiontEOFErrorR+t_logR(tselfR8t	transporttserver_version((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyR7Js&

				
cCs?|jd|d|ƒ}|dkr(dS|jdƒ||ƒS(s\
        Create an SFTP client channel from an open `.Transport`.

        Setting the window and packet sizes might affect the transfer speed.
        The default settings in the `.Transport` class are the same as in
        OpenSSH and should work adequately for both files transfers and
        interactive sessions.

        :param .Transport t: an open `.Transport` which is already
            authenticated
        :param int window_size:
            optional window size for the `.SFTPClient` session.
        :param int max_packet_size:
            optional max packet size for the `.SFTPClient` session..

        :return:
            a new `.SFTPClient` object, referring to an sftp session (channel)
            across the transport

        .. versionchanged:: 1.15
            Added the ``window_size`` and ``max_packet_size`` arguments.
        twindow_sizetmax_packet_sizetsftpN(topen_sessionR?tinvoke_subsystem(tclsttRPRQtchan((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytfrom_transportns	
cGs‚t|tƒr6xl|D]}|j|||ŒqWnH|jddƒ}tt|ƒj|d||jjƒgt|ƒŒdS(Nt%s%%s
[chan %s] (t
isinstancetlistRLtreplacetsuperR6R8tget_name(RMtleveltmsgtargstm((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyRLs
cCs!|jtdƒ|jjƒdS(sc
        Close the SFTP session and its underlying channel.

        .. versionadded:: 1.4
        ssftp session closed.N(RLRR8tclose(RM((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyRc™scCs|jS(sÇ
        Return the underlying `.Channel` object for this SFTP session.  This
        might be useful for doing things like setting a timeout on the channel.

        .. versionadded:: 1.7.1
        (R8(RM((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytget_channel¢st.cCs#g|j|ƒD]}|j^qS(sÎ
        Return a list containing the names of the entries in the given
        ``path``.

        The list is in arbitrary order.  It does not include the special
        entries ``'.'`` and ``'..'`` even if they are present in the folder.
        This method is meant to mirror ``os.listdir`` as closely as possible.
        For a list of full `.SFTPAttributes` objects, see `listdir_attr`.

        :param str path: path to list (defaults to ``'.'``)
        (tlistdir_attrtfilename(RMtpathtf((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytlistdir«scCsM|j|ƒ}|jtd|ƒ|jt|ƒ\}}|tkrVtdƒ‚n|jƒ}g}xÎtr8y|jt	|ƒ\}}Wnt
k
r¡PnX|tkr½tdƒ‚n|jƒ}xit
|ƒD][}|jƒ}|jƒ}	tj|||	ƒ}
|dkrÖ|dkrÖ|j|
ƒqÖqÖWqkW|jt|ƒ|S(s½
        Return a list containing `.SFTPAttributes` objects corresponding to
        files in the given ``path``.  The list is in arbitrary order.  It does
        not include the special entries ``'.'`` and ``'..'`` even if they are
        present in the folder.

        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 probably
        depend on the SFTP server implementation.

        :param str path: path to list (defaults to ``'.'``)
        :return: list of `.SFTPAttributes` objects

        .. versionadded:: 1.2
        slistdir(%r)sExpected handlesExpected name responseRes..(t_adjust_cwdRLRt_requestRR
Rt
get_binarytTrueRRKRtget_inttrangetget_textR*t	_from_msgtappendR(RMRhRVR`thandletfilelisttcounttiRgtlongnametattr((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyRf¹s.	
i2ccsÃ|j|ƒ}|jtd|ƒ|jt|ƒ\}}|tkrVtdƒ‚n|jƒ}tƒ}xQt	r¾y"x<t
|ƒD].}|jtdƒt|ƒ}|j|ƒq„WxÓ|D]Ë}|jƒ\}}	t|	ƒ}|jƒ}
||
kr|tkr|j|ƒqn|jƒ}xat
|ƒD]S}|jƒ}|jƒ}
tj|||
ƒ}|dkr1|dkr1|Vq1q1Wq½Wtƒ}Wqntk
rº|jt|ƒdSXqnWdS(sþ
        Generator version of `.listdir_attr`.

        See the API docs for `.listdir_attr` for overall details.

        This function adds one more kwarg on top of `.listdir_attr`:
        ``read_aheads``, an integer controlling how many
        ``SSH_FXP_READDIR`` requests are made to the server. The default of 50
        should suffice for most file listings as each request/response cycle
        may contain multiple files (dependent on server implementation.)

        .. versionadded:: 1.15
        slistdir(%r)sExpected handleRes..N(RkRLRRlRR
Rt
get_stringR[RnRpt_async_requestRDR?RRst_read_packetRRoR$t_convert_statusRqR*RrRKR(RMRhtread_aheadsRVR`RttnumsRwtnumtpkt_datatnew_numRvRgRxRy((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytlistdir_iterãs>			


triÿÿÿÿc	
Cs`|j|ƒ}|jtd||fƒd}d|ksGd|krT|tO}nd|ksxd|ksxd|kr…|tO}nd|kr¢|ttBO}nd|kr¿|ttBO}nd|krÜ|ttBO}nt	ƒ}|j
t|||ƒ\}}|tkrt
dƒ‚n|jƒ}|jtd	||t|ƒfƒt||||ƒS(
s[
        Open a file on the remote server.  The arguments are the same as for
        Python's built-in `python:file` (aka `python:open`).  A file-like
        object is returned, which closely mimics the behavior of a normal
        Python file object, including the ability to be used as a context
        manager.

        The mode indicates how the file is to be opened: ``'r'`` for reading,
        ``'w'`` for writing (truncating an existing file), ``'a'`` for
        appending, ``'r+'`` for reading/writing, ``'w+'`` for reading/writing
        (truncating an existing file), ``'a+'`` for reading/appending.  The
        Python ``'b'`` flag is ignored, since SSH treats all files as binary.
        The ``'U'`` flag is supported in a compatible way.

        Since 1.5.2, an ``'x'`` flag indicates that the operation should only
        succeed if the file was created and did not previously exist.  This has
        no direct mapping to Python's file flags, but is commonly known as the
        ``O_EXCL`` flag in posix.

        The file will be buffered in standard Python style by default, but
        can be altered with the ``bufsize`` parameter.  ``0`` turns off
        buffering, ``1`` uses line buffering, and any number greater than 1
        (``>1``) uses that specific buffer size.

        :param str filename: name of the file to open
        :param str mode: mode (Python-style) to open in
        :param int bufsize: desired buffering (-1 = default buffer size)
        :return: an `.SFTPFile` object representing the open file

        :raises: ``IOError`` -- if the file could not be opened.
        sopen(%r, %r)iR„t+twtatxsExpected handlesopen(%r, %r) -> %s(RkRLRRRRRRRR*RlRR
RRmRR,(	RMRgtmodetbufsizetimodet	attrblockRVR`Rt((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytopen$s, 
$
	cCs7|j|ƒ}|jtd|ƒ|jt|ƒdS(s 
        Remove the file at the given path.  This only works on files; for
        removing folders (directories), use `rmdir`.

        :param str path: path (absolute or relative) of the file to remove

        :raises: ``IOError`` -- if the path refers to a folder (directory)
        s
remove(%r)N(RkRLRRlR(RMRh((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytremove^s	cCsO|j|ƒ}|j|ƒ}|jtd||fƒ|jt||ƒdS(si
        Rename a file or folder from ``oldpath`` to ``newpath``.

        :param str oldpath:
            existing name of the file or folder
        :param str newpath:
            new name for the file or folder, must not exist already

        :raises:
            ``IOError`` -- if ``newpath`` is a folder, or something else goes
            wrong
        srename(%r, %r)N(RkRLRRlR(RMtoldpathtnewpath((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytrenamems
cCsR|j|ƒ}|j|ƒ}|jtd||fƒ|jtd||ƒdS(sÀ
        Rename a file or folder from ``oldpath`` to ``newpath``, following
        posix conventions.

        :param str oldpath: existing name of the file or folder
        :param str newpath: new name for the file or folder, will be
            overwritten if it already exists

        :raises:
            ``IOError`` -- if ``newpath`` is a folder, posix-rename is not
            supported by the server or something else goes wrong
        sposix_rename(%r, %r)sposix-rename@openssh.comN(RkRLRRlR%(RMRR((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytposix_renames

cCsR|j|ƒ}|jtd||fƒtƒ}||_|jt||ƒdS(ss
        Create a folder (directory) named ``path`` with numeric mode ``mode``.
        The default mode is 0777 (octal).  On some systems, mode is ignored.
        Where it is used, the current umask value is first masked out.

        :param str path: name of the folder to create
        :param int mode: permissions (posix-style) for the newly-created folder
        s
mkdir(%r, %r)N(RkRLRR*tst_modeRlR(RMRhR‰Ry((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytmkdir“s
			cCs7|j|ƒ}|jtd|ƒ|jt|ƒdS(sj
        Remove the folder named ``path``.

        :param str path: name of the folder to remove
        s	rmdir(%r)N(RkRLRRlR(RMRh((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytrmdir¢scCsc|j|ƒ}|jtd|ƒ|jt|ƒ\}}|tkrVtdƒ‚ntj|ƒS(s8
        Retrieve information about a file on the remote system.  The return
        value is an object whose attributes correspond to the attributes of
        Python's ``stat`` structure as returned by ``os.stat``, except that it
        contains fewer fields.  An SFTP server may return as much or as little
        info as it wants, so the results may vary from server to server.

        Unlike a Python `python:stat` object, the result may not be accessed as
        a tuple.  This is mostly due to the author's slack factor.

        The fields supported are: ``st_mode``, ``st_size``, ``st_uid``,
        ``st_gid``, ``st_atime``, and ``st_mtime``.

        :param str path: the filename to stat
        :return:
            an `.SFTPAttributes` object containing attributes about the given
            file
        sstat(%r)sExpected attributes(	RkRLRRlRRRR*Rr(RMRhRVR`((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytstat¬scCsc|j|ƒ}|jtd|ƒ|jt|ƒ\}}|tkrVtdƒ‚ntj|ƒS(sZ
        Retrieve information about a file on the remote system, without
        following symbolic links (shortcuts).  This otherwise behaves exactly
        the same as `stat`.

        :param str path: the filename to stat
        :return:
            an `.SFTPAttributes` object containing attributes about the given
            file
        s	lstat(%r)sExpected attributes(	RkRLRRlRRRR*Rr(RMRhRVR`((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytlstatÆscCsL|j|ƒ}|jtd||fƒt|ƒ}|jt||ƒdS(sÄ
        Create a symbolic link to the ``source`` path at ``destination``.

        :param str source: path of the original file
        :param str dest: path of the newly created symlink
        ssymlink(%r, %r)N(RkRLRRRlR (RMtsourcetdest((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytsymlinkØscCsR|j|ƒ}|jtd||fƒtƒ}||_|jt||ƒdS(s
        Change the mode (permissions) of a file.  The permissions are
        unix-style and identical to those used by Python's `os.chmod`
        function.

        :param str path: path of the file to change the permissions of
        :param int mode: new permissions
        s
chmod(%r, %r)N(RkRLRR*R“RlR!(RMRhR‰Ry((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytchmodäs
			cCs_|j|ƒ}|jtd|||fƒtƒ}|||_|_|jt||ƒdS(sž
        Change the owner (``uid``) and group (``gid``) of a file.  As with
        Python's `os.chown` function, you must pass both arguments, so if you
        only want to change one, use `stat` first to retrieve the current
        owner and group.

        :param str path: path of the file to change the owner and group of
        :param int uid: new owner's uid
        :param int gid: new group id
        schown(%r, %r, %r)N(RkRLRR*tst_uidtst_gidRlR!(RMRhtuidtgidRy((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytchownós
	cCs‚|j|ƒ}|dkr6tjƒtjƒf}n|jtd||fƒtƒ}|\|_|_|jt	||ƒdS(s¬
        Set the access and modified times of the file specified by ``path``.
        If ``times`` is ``None``, then the file's access and modified times
        are set to the current time.  Otherwise, ``times`` must be a 2-tuple
        of numbers, of the form ``(atime, mtime)``, which is used to set the
        access and modified times, respectively.  This bizarre API is mimicked
        from Python for the sake of consistency -- I apologize.

        :param str path: path of the file to modify
        :param tuple times:
            ``None`` or a tuple of (access time, modified time) in standard
            internet epoch time (seconds since 01 January 1970 GMT)
        s
utime(%r, %r)N(
RkR?ttimeRLRR*tst_atimetst_mtimeRlR!(RMRhttimesRy((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytutimes	cCsR|j|ƒ}|jtd||fƒtƒ}||_|jt||ƒdS(s0
        Change the size of the file specified by ``path``.  This usually
        extends or shrinks the size of the file, just like the `~file.truncate`
        method on Python file objects.

        :param str path: path of the file to modify
        :param int size: the new size of the file
        struncate(%r, %r)N(RkRLRR*tst_sizeRlR!(RMRhtsizeRy((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyttruncates
			cCs¡|j|ƒ}|jtd|ƒ|jt|ƒ\}}|tkrVtdƒ‚n|jƒ}|dkrrdS|dkr‘td|ƒ‚nt	|j
ƒƒS(s
        Return the target of a symbolic link (shortcut).  You can use
        `symlink` to create these.  The result may be either an absolute or
        relative pathname.

        :param str path: path of the symbolic link file
        :return: target path, as a `str`
        sreadlink(%r)sExpected name responseiisReadlink returned %d resultsN(RkRLRRlR"RRRoR?R4Rz(RMRhRVR`Rv((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytreadlink)s	cCs‹|j|ƒ}|jtd|ƒ|jt|ƒ\}}|tkrVtdƒ‚n|jƒ}|dkrtd|ƒ‚n|jƒS(s¿
        Return the normalized path (on the server) of a given path.  This
        can be used to quickly resolve symbolic links or determine what the
        server is considering to be the "current folder" (by passing ``'.'``
        as ``path``).

        :param str path: path to be normalized
        :return: normalized form of the given path (as a `str`)

        :raises: ``IOError`` -- if the path can't be resolved on the server
        s
normalize(%r)sExpected name responseisRealpath returned %d results(	RkRLRRlR#RRRoRq(RMRhRVR`Rv((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyt	normalize>scCs{|dkrd|_dStj|j|ƒjƒs_ttjdtj	tjƒ|fƒ‚nt
|j|ƒƒ|_dS(sS
        Change the "current directory" of this SFTP session.  Since SFTP
        doesn't really have the concept of a current working directory, this is
        emulated by Paramiko.  Once you use this method to set a working
        directory, all operations on this `.SFTPClient` object will be relative
        to that path. You can pass in ``None`` to stop using a current working
        directory.

        :param str path: new current working directory

        :raises:
            ``IOError`` -- if the requested path doesn't exist on the server

        .. versionadded:: 1.4
        Ns%s: %s(R?R@R–tS_ISDIRR“RterrnotENOTDIRtoststrerrorRRª(RMRh((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytchdirTs	(cCs|jot|jƒS(så
        Return the "current working directory" for this SFTP session, as
        emulated by Paramiko.  If no directory has been set with `chdir`,
        this method will return ``None``.

        .. versionadded:: 1.4
        (R@R	(RM((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytgetcwdls	cCsud}xhtrp|jdƒ}|j|ƒ|t|ƒ7}t|ƒdkrQPn|dk	r	|||ƒq	q	W|S(Nii€(RntreadtwritetlenR?(RMtreadertwritert	file_sizetcallbackR§tdata((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyt_transfer_with_callbackws	
ic	
Csœ|j|dƒ8}|jtƒ|jd|d|d|d|ƒ}WdQX|r|j|ƒ}|j|kr˜td|j|fƒ‚q˜n	tƒ}|S(sï
        Copy the contents of an open file object (``fl``) to the SFTP server as
        ``remotepath``. Any exception raised by operations will be passed
        through.

        The SFTP operations use pipelining for speed.

        :param fl: opened file or file-like object to copy
        :param str remotepath: the destination path on the SFTP server
        :param int file_size:
            optional size parameter passed to callback. If none is specified,
            size defaults to 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
            (since 1.7.4)
        :param bool confirm:
            whether to do a stat() on the file afterwards to confirm the file
            size (since 1.7.7)

        :return:
            an `.SFTPAttributes` object containing attributes about the given
            file.

        .. versionadded:: 1.10
        twbRµR¶R·R¸Nssize mismatch in put!  %d != %d(tfilet
set_pipelinedRnRºR–R¦tIOErrorR*(	RMtflt
remotepathR·R¸tconfirmtfrR§R3((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytputfoƒs
	!	c
CsGtj|ƒj}t|dƒ }|j|||||ƒSWdQXdS(sn
        Copy a local file (``localpath``) to the SFTP server as ``remotepath``.
        Any exception raised by operations will be passed through.  This
        method is primarily provided as a convenience.

        The SFTP operations use pipelining for speed.

        :param str localpath: the local file to copy
        :param str remotepath: the destination path on the SFTP server. Note
            that the filename should be included. Only specifying a directory
            may result in an error.
        :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

        :return: an `.SFTPAttributes` object containing attributes about the
            given file

        .. versionadded:: 1.4
        .. versionchanged:: 1.7.4
            ``callback`` and rich attribute return value added.
        .. versionchanged:: 1.7.7
            ``confirm`` param added.
        trbN(R®R–R¦RRÃ(RMt	localpathRÀR¸RÁR·R¿((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytput¬sc
Cs`|j|ƒj}|j|dƒ6}|j|ƒ|jd|d|d|d|ƒSWdQXdS(så
        Copy a remote file (``remotepath``) from the SFTP server and write to
        an open file or file-like object, ``fl``.  Any exception raised by
        operations will be passed through.  This method is primarily provided
        as a convenience.

        :param object remotepath: opened file or file-like object to copy to
        :param str fl:
            the destination path on the local host or open file object
        :param callable callback:
            optional callback function (form: ``func(int, int)``) that accepts
            the bytes transferred so far and the total bytes to be transferred
        :return: the `number <int>` of bytes written to the opened file object

        .. versionadded:: 1.10
        RÄRµR¶R·R¸N(R–R¦RtprefetchRº(RMRÀR¿R¸R·RÂ((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytgetfoÌs

	cCskt|dƒ}|j|||ƒ}WdQXtj|ƒ}|j|krgtd|j|fƒ‚ndS(s–
        Copy a remote file (``remotepath``) from the SFTP server to the local
        host as ``localpath``.  Any exception raised by operations will be
        passed through.  This method is primarily provided as a convenience.

        :param str remotepath: the remote file to copy
        :param str localpath: the destination path on the local host
        :param callable callback:
            optional callback function (form: ``func(int, int)``) that accepts
            the bytes transferred so far and the total bytes to be transferred

        .. versionadded:: 1.4
        .. versionchanged:: 1.7.4
            Added the ``callback`` param
        R»Nssize mismatch in get!  %d != %d(RRÈR®R–R¦R¾(RMRÀRÅR¸R¿R§R3((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pytgetäscGs(|jtdƒ||Œ}|j|ƒS(N(R{RDR?t_read_response(RMRVtargR€((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyRlýscGsï|jjƒz½tƒ}|j|jƒxx|D]p}t|tƒrU|j|ƒq0t|tƒrt|j|ƒq0t|t	ƒr“|j
|ƒq0|j|ƒq0W|j}||j|<|jd7_Wd|jj
ƒX|j||ƒ|S(Ni(R>tacquireRtadd_intR;RZR
t	add_int64tintR*t_packt
add_stringRCtreleaset_send_packet(RMtfileobjRVRËR`titemR€((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyR{s$
	
	
cCsJxCtrEy|jƒ\}}Wn)tk
rJ}tdt|ƒƒ‚nXt|ƒ}|jƒ}|jjƒzW||j	kr¯|j
td|fƒ|dkr©Pnwn|j	|}|j	|=Wd|jj
ƒX||kr
|tkr|j|ƒn||fS|tdƒk	r2|j|||ƒn|dkrPqqWdS(NsServer connection dropped: %ssUnexpected response #%d(NN(RnR|RKR+tstrRRoR>RÌRCRLRR?RÒR$R}RDt_async_response(RMtwaitforRVR¹teR`R€RÔ((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyRÊs4	


cCs4x-||jjƒkr/|jƒ|jƒqWdS(N(RCtvaluesRÊt_check_exception(RMRÔ((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyt_finish_responses?s
cCs•|jƒ}|jƒ}|tkr(dS|tkrCt|ƒ‚nN|tkrdttj|ƒ‚n-|t	kr…ttj
|ƒ‚nt|ƒ‚dS(sU
        Raises EOFError or IOError on error status; otherwise does nothing.
        N(RoRqR&R'RKR(R¾R¬tENOENTR)tEACCES(RMR`tcodettext((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyR}DscCskt|ƒ}|jdkr|St|ƒrB|dd!tkrB|S|jtkr\|j|S|jt|S(sr
        Return an adjusted path if we're emulating a "current working
        directory" for the server.
        iiN(RR@R?R´tb_slash(RMRh((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyRkVsN(-t__name__t
__module__t__doc__R7tclassmethodR?RXRLRcRdRjRfRƒRR¼RŽtunlinkR‘R’RR”R•R–R—RšR›R R¥R¨R©RªR°R±RºRnRÃRÆRÈRÉRlR{RÊRÜR}Rk(((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyR6AsP	$					*A8	
			
											) 		%		tSFTPcBseZdZRS(sA
    An alias for `.SFTPClient` for backwards compatibility.
    (RâRãRä(((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyRçfs(CtbinasciiRR¬R®R–R<R¡RAtparamikoRtparamiko.channelRtparamiko.messageRtparamiko.commonRRRtparamiko.py3compatRRR	R
t
paramiko.sftpRRR
RRRRRRRRRRRRRRRRRRR R!R"R#R$R%R&R'R(R)tparamiko.sftp_attrR*tparamiko.ssh_exceptionR+tparamiko.sftp_fileR,t
paramiko.utilR-R4RáR6Rç(((sI/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/sftp_client.pyt<module>s."Ä		ÿÿÿ(