diff options
Diffstat (limited to 'docs/paramiko.sftp_file-pysrc.html')
-rw-r--r-- | docs/paramiko.sftp_file-pysrc.html | 95 |
1 files changed, 48 insertions, 47 deletions
diff --git a/docs/paramiko.sftp_file-pysrc.html b/docs/paramiko.sftp_file-pysrc.html index 5e9b4c7..86f8884 100644 --- a/docs/paramiko.sftp_file-pysrc.html +++ b/docs/paramiko.sftp_file-pysrc.html @@ -54,24 +54,24 @@ </table> <h1 class="epydoc">Source Code for <a href="paramiko.sftp_file-module.html" onclick="show_private();">Module paramiko.sftp_file</a></h1> <pre class="py-src"> -<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment"># Copyright (C) 2003-2007 Robey Pointer <robey@lag.net></tt> </tt> -<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt> -<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># This file is part of paramiko.</tt> </tt> -<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt> -<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Paramiko is free software; you can redistribute it and/or modify it under the</tt> </tt> -<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># terms of the GNU Lesser General Public License as published by the Free</tt> </tt> -<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Software Foundation; either version 2.1 of the License, or (at your option)</tt> </tt> -<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># any later version.</tt> </tt> -<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt> -<a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY</tt> </tt> -<a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR</tt> </tt> -<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more</tt> </tt> -<a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># details.</tt> </tt> -<a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt> -<a name="L15"></a><tt class="py-lineno"> 15</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># You should have received a copy of the GNU Lesser General Public License</tt> </tt> -<a name="L16"></a><tt class="py-lineno"> 16</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># along with Paramiko; if not, write to the Free Software Foundation, Inc.,</tt> </tt> -<a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.</tt> </tt> -<a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"><tt class="py-comment"></tt> </tt> +<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment"># Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com></tt> </tt> +<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt> +<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-comment"># This file is part of paramiko.</tt> </tt> +<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt> +<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-comment"># Paramiko is free software; you can redistribute it and/or modify it under the</tt> </tt> +<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-comment"># terms of the GNU Lesser General Public License as published by the Free</tt> </tt> +<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-comment"># Software Foundation; either version 2.1 of the License, or (at your option)</tt> </tt> +<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-comment"># any later version.</tt> </tt> +<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt> +<a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"><tt class="py-comment"># Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY</tt> </tt> +<a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt class="py-comment"># WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR</tt> </tt> +<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"><tt class="py-comment"># A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more</tt> </tt> +<a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"><tt class="py-comment"># details.</tt> </tt> +<a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt> +<a name="L15"></a><tt class="py-lineno"> 15</tt> <tt class="py-line"><tt class="py-comment"># You should have received a copy of the GNU Lesser General Public License</tt> </tt> +<a name="L16"></a><tt class="py-lineno"> 16</tt> <tt class="py-line"><tt class="py-comment"># along with Paramiko; if not, write to the Free Software Foundation, Inc.,</tt> </tt> +<a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"><tt class="py-comment"># 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.</tt> </tt> +<a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"> </tt> <a name="L19"></a><tt class="py-lineno"> 19</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt> <a name="L20"></a><tt class="py-lineno"> 20</tt> <tt class="py-line"><tt class="py-docstring">L{SFTPFile}</tt> </tt> <a name="L21"></a><tt class="py-lineno"> 21</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt> @@ -94,11 +94,11 @@ paramiko.file" class="py-name" href="#" onclick="return doclink('link-5', 'file' <a name="L37"></a><tt class="py-lineno"> 37</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt> <a name="L38"></a><tt class="py-lineno"> 38</tt> <tt class="py-line"> </tt> <a name="L39"></a><tt class="py-lineno"> 39</tt> <tt class="py-line"> <tt class="py-comment"># Some sftp servers will choke if you send read/write requests larger than</tt> </tt> -<a name="L40"></a><tt class="py-lineno"> 40</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># this size.</tt> </tt> -<a name="L41"></a><tt class="py-lineno"> 41</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt id="link-10" class="py-name" targets="Variable paramiko.SFTPFile.MAX_REQUEST_SIZE=paramiko.SFTPFile-class.html#MAX_REQUEST_SIZE"><a title="paramiko.SFTPFile.MAX_REQUEST_SIZE" class="py-name" href="#" onclick="return doclink('link-10', 'MAX_REQUEST_SIZE', 'link-10');">MAX_REQUEST_SIZE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">32768</tt> </tt> +<a name="L40"></a><tt class="py-lineno"> 40</tt> <tt class="py-line"> <tt class="py-comment"># this size.</tt> </tt> +<a name="L41"></a><tt class="py-lineno"> 41</tt> <tt class="py-line"> <tt id="link-10" class="py-name" targets="Variable paramiko.SFTPFile.MAX_REQUEST_SIZE=paramiko.SFTPFile-class.html#MAX_REQUEST_SIZE"><a title="paramiko.SFTPFile.MAX_REQUEST_SIZE" class="py-name" href="#" onclick="return doclink('link-10', 'MAX_REQUEST_SIZE', 'link-10');">MAX_REQUEST_SIZE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">32768</tt> </tt> <a name="L42"></a><tt class="py-lineno"> 42</tt> <tt class="py-line"> </tt> <a name="SFTPFile.__init__"></a><div id="SFTPFile.__init__-def"><a name="L43"></a><tt class="py-lineno"> 43</tt> <a class="py-toggle" href="#" id="SFTPFile.__init__-toggle" onclick="return toggle('SFTPFile.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="paramiko.sftp_file.SFTPFile-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">sftp</tt><tt class="py-op">,</tt> <tt class="py-param">handle</tt><tt class="py-op">,</tt> <tt class="py-param">mode</tt><tt class="py-op">=</tt><tt class="py-string">'r'</tt><tt class="py-op">,</tt> <tt class="py-param">bufsize</tt><tt class="py-op">=</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> -</div><div id="SFTPFile.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SFTPFile.__init__-expanded"><a name="L44"></a><tt class="py-lineno"> 44</tt> <tt class="py-line"> <tt id="link-11" class="py-name"><a title="paramiko.BufferedFile" class="py-name" href="#" onclick="return doclink('link-11', 'BufferedFile', 'link-6');">BufferedFile</a></tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method paramiko.Agent.__init__()=paramiko.Agent-class.html#__init__,Method paramiko.AgentKey.__init__()=paramiko.AgentKey-class.html#__init__,Method paramiko.BadAuthenticationType.__init__()=paramiko.BadAuthenticationType-class.html#__init__,Method paramiko.BadHostKeyException.__init__()=paramiko.BadHostKeyException-class.html#__init__,Method paramiko.BufferedFile.__init__()=paramiko.BufferedFile-class.html#__init__,Method paramiko.Channel.__init__()=paramiko.Channel-class.html#__init__,Method paramiko.ChannelException.__init__()=paramiko.ChannelException-class.html#__init__,Method paramiko.DSSKey.__init__()=paramiko.DSSKey-class.html#__init__,Method paramiko.HostKeys.__init__()=paramiko.HostKeys-class.html#__init__,Method paramiko.Message.__init__()=paramiko.Message-class.html#__init__,Method paramiko.PKey.__init__()=paramiko.PKey-class.html#__init__,Method paramiko.RSAKey.__init__()=paramiko.RSAKey-class.html#__init__,Method paramiko.SFTPAttributes.__init__()=paramiko.SFTPAttributes-class.html#__init__,Method paramiko.SFTPClient.__init__()=paramiko.SFTPClient-class.html#__init__,Method paramiko.SFTPFile.__init__()=paramiko.SFTPFile-class.html#__init__,Method paramiko.SFTPHandle.__init__()=paramiko.SFTPHandle-class.html#__init__,Method paramiko.SFTPServer.__init__()=paramiko.SFTPServer-class.html#__init__,Method paramiko.SFTPServerInterface.__init__()=paramiko.SFTPServerInterface-class.html#__init__,Method paramiko.SSHClient.__init__()=paramiko.SSHClient-class.html#__init__,Method paramiko.SSHConfig.__init__()=paramiko.SSHConfig-class.html#__init__,Method paramiko.SecurityOptions.__init__()=paramiko.SecurityOptions-class.html#__init__,Method paramiko.SubsystemHandler.__init__()=paramiko.SubsystemHandler-class.html#__init__,Method paramiko.Transport.__init__()=paramiko.Transport-class.html#__init__,Method paramiko.ber.BER.__init__()=paramiko.ber.BER-class.html#__init__,Method paramiko.buffered_pipe.BufferedPipe.__init__()=paramiko.buffered_pipe.BufferedPipe-class.html#__init__,Method paramiko.channel.ChannelStderrFile.__init__()=paramiko.channel.ChannelStderrFile-class.html#__init__,Method paramiko.compress.ZlibCompressor.__init__()=paramiko.compress.ZlibCompressor-class.html#__init__,Method paramiko.compress.ZlibDecompressor.__init__()=paramiko.compress.ZlibDecompressor-class.html#__init__,Method paramiko.hostkeys.HostKeyEntry.__init__()=paramiko.hostkeys.HostKeyEntry-class.html#__init__,Method paramiko.kex_gex.KexGex.__init__()=paramiko.kex_gex.KexGex-class.html#__init__,Method paramiko.kex_group1.KexGroup1.__init__()=paramiko.kex_group1.KexGroup1-class.html#__init__,Method paramiko.logging22.Formatter.__init__()=paramiko.logging22.Formatter-class.html#__init__,Method paramiko.logging22.StreamHandler.__init__()=paramiko.logging22.StreamHandler-class.html#__init__,Method paramiko.logging22.logger.__init__()=paramiko.logging22.logger-class.html#__init__,Method paramiko.pipe.OrPipe.__init__()=paramiko.pipe.OrPipe-class.html#__init__,Method paramiko.pipe.PosixPipe.__init__()=paramiko.pipe.PosixPipe-class.html#__init__,Method paramiko.pipe.WindowsPipe.__init__()=paramiko.pipe.WindowsPipe-class.html#__init__,Method paramiko.primes.ModulusPack.__init__()=paramiko.primes.ModulusPack-class.html#__init__,Method paramiko.rng.StrongLockingRandomPool.__init__()=paramiko.rng.StrongLockingRandomPool-class.html#__init__,Method paramiko.ssh_exception.PartialAuthentication.__init__()=paramiko.ssh_exception.PartialAuthentication-class.html#__init__,Method paramiko.transport.ChannelMap.__init__()=paramiko.transport.ChannelMap-class.html#__init__,Method paramiko.util.enumerate.__init__()=paramiko.util.enumerate-class.html#__init__,Method paramiko.win_pageant.PageantConnection.__init__()=paramiko.win_pageant.PageantConnection-class.html#__init__"><a title="paramiko.Agent.__init__ +</div><div id="SFTPFile.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SFTPFile.__init__-expanded"><a name="L44"></a><tt class="py-lineno"> 44</tt> <tt class="py-line"> <tt id="link-11" class="py-name"><a title="paramiko.BufferedFile" class="py-name" href="#" onclick="return doclink('link-11', 'BufferedFile', 'link-6');">BufferedFile</a></tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method paramiko.Agent.__init__()=paramiko.Agent-class.html#__init__,Method paramiko.AgentKey.__init__()=paramiko.AgentKey-class.html#__init__,Method paramiko.BadAuthenticationType.__init__()=paramiko.BadAuthenticationType-class.html#__init__,Method paramiko.BadHostKeyException.__init__()=paramiko.BadHostKeyException-class.html#__init__,Method paramiko.BufferedFile.__init__()=paramiko.BufferedFile-class.html#__init__,Method paramiko.Channel.__init__()=paramiko.Channel-class.html#__init__,Method paramiko.ChannelException.__init__()=paramiko.ChannelException-class.html#__init__,Method paramiko.DSSKey.__init__()=paramiko.DSSKey-class.html#__init__,Method paramiko.HostKeys.__init__()=paramiko.HostKeys-class.html#__init__,Method paramiko.Message.__init__()=paramiko.Message-class.html#__init__,Method paramiko.PKey.__init__()=paramiko.PKey-class.html#__init__,Method paramiko.RSAKey.__init__()=paramiko.RSAKey-class.html#__init__,Method paramiko.SFTPAttributes.__init__()=paramiko.SFTPAttributes-class.html#__init__,Method paramiko.SFTPClient.__init__()=paramiko.SFTPClient-class.html#__init__,Method paramiko.SFTPFile.__init__()=paramiko.SFTPFile-class.html#__init__,Method paramiko.SFTPHandle.__init__()=paramiko.SFTPHandle-class.html#__init__,Method paramiko.SFTPServer.__init__()=paramiko.SFTPServer-class.html#__init__,Method paramiko.SFTPServerInterface.__init__()=paramiko.SFTPServerInterface-class.html#__init__,Method paramiko.SSHClient.__init__()=paramiko.SSHClient-class.html#__init__,Method paramiko.SSHConfig.__init__()=paramiko.SSHConfig-class.html#__init__,Method paramiko.SecurityOptions.__init__()=paramiko.SecurityOptions-class.html#__init__,Method paramiko.SubsystemHandler.__init__()=paramiko.SubsystemHandler-class.html#__init__,Method paramiko.Transport.__init__()=paramiko.Transport-class.html#__init__,Method paramiko.ber.BER.__init__()=paramiko.ber.BER-class.html#__init__,Method paramiko.buffered_pipe.BufferedPipe.__init__()=paramiko.buffered_pipe.BufferedPipe-class.html#__init__,Method paramiko.channel.ChannelStderrFile.__init__()=paramiko.channel.ChannelStderrFile-class.html#__init__,Method paramiko.compress.ZlibCompressor.__init__()=paramiko.compress.ZlibCompressor-class.html#__init__,Method paramiko.compress.ZlibDecompressor.__init__()=paramiko.compress.ZlibDecompressor-class.html#__init__,Method paramiko.hostkeys.HostKeyEntry.__init__()=paramiko.hostkeys.HostKeyEntry-class.html#__init__,Method paramiko.kex_gex.KexGex.__init__()=paramiko.kex_gex.KexGex-class.html#__init__,Method paramiko.kex_group1.KexGroup1.__init__()=paramiko.kex_group1.KexGroup1-class.html#__init__,Method paramiko.logging22.Formatter.__init__()=paramiko.logging22.Formatter-class.html#__init__,Method paramiko.logging22.StreamHandler.__init__()=paramiko.logging22.StreamHandler-class.html#__init__,Method paramiko.logging22.logger.__init__()=paramiko.logging22.logger-class.html#__init__,Method paramiko.pipe.OrPipe.__init__()=paramiko.pipe.OrPipe-class.html#__init__,Method paramiko.pipe.PosixPipe.__init__()=paramiko.pipe.PosixPipe-class.html#__init__,Method paramiko.pipe.WindowsPipe.__init__()=paramiko.pipe.WindowsPipe-class.html#__init__,Method paramiko.primes.ModulusPack.__init__()=paramiko.primes.ModulusPack-class.html#__init__,Method paramiko.rng.StrongLockingRandomPool.__init__()=paramiko.rng.StrongLockingRandomPool-class.html#__init__,Method paramiko.ssh_exception.PartialAuthentication.__init__()=paramiko.ssh_exception.PartialAuthentication-class.html#__init__,Method paramiko.transport.ChannelMap.__init__()=paramiko.transport.ChannelMap-class.html#__init__,Method paramiko.util.Counter.__init__()=paramiko.util.Counter-class.html#__init__,Method paramiko.util.enumerate.__init__()=paramiko.util.enumerate-class.html#__init__,Method paramiko.win_pageant.PageantConnection.__init__()=paramiko.win_pageant.PageantConnection-class.html#__init__"><a title="paramiko.Agent.__init__ paramiko.AgentKey.__init__ paramiko.BadAuthenticationType.__init__ paramiko.BadHostKeyException.__init__ @@ -139,6 +139,7 @@ paramiko.primes.ModulusPack.__init__ paramiko.rng.StrongLockingRandomPool.__init__ paramiko.ssh_exception.PartialAuthentication.__init__ paramiko.transport.ChannelMap.__init__ +paramiko.util.Counter.__init__ paramiko.util.enumerate.__init__ paramiko.win_pageant.PageantConnection.__init__" class="py-name" href="#" onclick="return doclink('link-12', '__init__', 'link-12');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt> <a name="L45"></a><tt class="py-lineno"> 45</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="paramiko.sftp" class="py-name" href="#" onclick="return doclink('link-13', 'sftp', 'link-3');">sftp</a></tt> <tt class="py-op">=</tt> <tt id="link-14" class="py-name"><a title="paramiko.sftp" class="py-name" href="#" onclick="return doclink('link-14', 'sftp', 'link-3');">sftp</a></tt> </tt> @@ -159,13 +160,13 @@ paramiko.win_pageant.PageantConnection.__init__" class="py-name" href="#" onclic </div><a name="L60"></a><tt class="py-lineno"> 60</tt> <tt class="py-line"> </tt> <a name="SFTPFile._close"></a><div id="SFTPFile._close-def"><a name="L61"></a><tt class="py-lineno"> 61</tt> <a class="py-toggle" href="#" id="SFTPFile._close-toggle" onclick="return toggle('SFTPFile._close');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="paramiko.sftp_file.SFTPFile-class.html#_close">_close</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">async</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> </div><div id="SFTPFile._close-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SFTPFile._close-expanded"><a name="L62"></a><tt class="py-lineno"> 62</tt> <tt class="py-line"> <tt class="py-comment"># We allow double-close without signaling an error, because real</tt> </tt> -<a name="L63"></a><tt class="py-lineno"> 63</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># Python file objects do. However, we must protect against actually</tt> </tt> -<a name="L64"></a><tt class="py-lineno"> 64</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># sending multiple CMD_CLOSE packets, because after we close our</tt> </tt> -<a name="L65"></a><tt class="py-lineno"> 65</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># handle, the same handle may be re-allocated by the server, and we</tt> </tt> -<a name="L66"></a><tt class="py-lineno"> 66</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># may end up mysteriously closing some random other file. (This is</tt> </tt> -<a name="L67"></a><tt class="py-lineno"> 67</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># especially important because we unconditionally call close() from</tt> </tt> -<a name="L68"></a><tt class="py-lineno"> 68</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># __del__.)</tt> </tt> -<a name="L69"></a><tt class="py-lineno"> 69</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_closed</tt><tt class="py-op">:</tt> </tt> +<a name="L63"></a><tt class="py-lineno"> 63</tt> <tt class="py-line"> <tt class="py-comment"># Python file objects do. However, we must protect against actually</tt> </tt> +<a name="L64"></a><tt class="py-lineno"> 64</tt> <tt class="py-line"> <tt class="py-comment"># sending multiple CMD_CLOSE packets, because after we close our</tt> </tt> +<a name="L65"></a><tt class="py-lineno"> 65</tt> <tt class="py-line"> <tt class="py-comment"># handle, the same handle may be re-allocated by the server, and we</tt> </tt> +<a name="L66"></a><tt class="py-lineno"> 66</tt> <tt class="py-line"> <tt class="py-comment"># may end up mysteriously closing some random other file. (This is</tt> </tt> +<a name="L67"></a><tt class="py-lineno"> 67</tt> <tt class="py-line"> <tt class="py-comment"># especially important because we unconditionally call close() from</tt> </tt> +<a name="L68"></a><tt class="py-lineno"> 68</tt> <tt class="py-line"> <tt class="py-comment"># __del__.)</tt> </tt> +<a name="L69"></a><tt class="py-lineno"> 69</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_closed</tt><tt class="py-op">:</tt> </tt> <a name="L70"></a><tt class="py-lineno"> 70</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> </tt> <a name="L71"></a><tt class="py-lineno"> 71</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name"><a title="paramiko.sftp" class="py-name" href="#" onclick="return doclink('link-16', 'sftp', 'link-3');">sftp</a></tt><tt class="py-op">.</tt><tt class="py-name">_log</tt><tt class="py-op">(</tt><tt id="link-17" class="py-name" targets="Variable paramiko.auth_handler.DEBUG=paramiko.auth_handler-module.html#DEBUG,Variable paramiko.channel.DEBUG=paramiko.channel-module.html#DEBUG,Variable paramiko.client.DEBUG=paramiko.client-module.html#DEBUG,Variable paramiko.common.DEBUG=paramiko.common-module.html#DEBUG,Variable paramiko.dsskey.DEBUG=paramiko.dsskey-module.html#DEBUG,Variable paramiko.hostkeys.DEBUG=paramiko.hostkeys-module.html#DEBUG,Variable paramiko.kex_gex.DEBUG=paramiko.kex_gex-module.html#DEBUG,Variable paramiko.kex_group1.DEBUG=paramiko.kex_group1-module.html#DEBUG,Variable paramiko.logging22.DEBUG=paramiko.logging22-module.html#DEBUG,Variable paramiko.packet.DEBUG=paramiko.packet-module.html#DEBUG,Variable paramiko.pkey.DEBUG=paramiko.pkey-module.html#DEBUG,Variable paramiko.rsakey.DEBUG=paramiko.rsakey-module.html#DEBUG,Variable paramiko.server.DEBUG=paramiko.server-module.html#DEBUG,Variable paramiko.sftp.DEBUG=paramiko.sftp-module.html#DEBUG,Variable paramiko.sftp_attr.DEBUG=paramiko.sftp_attr-module.html#DEBUG,Variable paramiko.sftp_client.DEBUG=paramiko.sftp_client-module.html#DEBUG,Variable paramiko.sftp_file.DEBUG=paramiko.sftp_file-module.html#DEBUG,Variable paramiko.sftp_handle.DEBUG=paramiko.sftp_handle-module.html#DEBUG,Variable paramiko.sftp_server.DEBUG=paramiko.sftp_server-module.html#DEBUG,Variable paramiko.sftp_si.DEBUG=paramiko.sftp_si-module.html#DEBUG,Variable paramiko.transport.DEBUG=paramiko.transport-module.html#DEBUG,Variable paramiko.util.DEBUG=paramiko.util-module.html#DEBUG"><a title="paramiko.auth_handler.DEBUG paramiko.channel.DEBUG @@ -206,7 +207,7 @@ paramiko.win_pageant.PageantConnection.close" class="py-name" href="#" onclick=" <a name="L75"></a><tt class="py-lineno"> 75</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt> <a name="L76"></a><tt class="py-lineno"> 76</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">async</tt><tt class="py-op">:</tt> </tt> <a name="L77"></a><tt class="py-lineno"> 77</tt> <tt class="py-line"> <tt class="py-comment"># GC'd file handle could be called from an arbitrary thread -- don't wait for a response</tt> </tt> -<a name="L78"></a><tt class="py-lineno"> 78</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="paramiko.sftp" class="py-name" href="#" onclick="return doclink('link-21', 'sftp', 'link-3');">sftp</a></tt><tt class="py-op">.</tt><tt class="py-name">_async_request</tt><tt class="py-op">(</tt><tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt id="link-22" class="py-name" targets="Variable paramiko.sftp.CMD_CLOSE=paramiko.sftp-module.html#CMD_CLOSE,Variable paramiko.sftp_attr.CMD_CLOSE=paramiko.sftp_attr-module.html#CMD_CLOSE,Variable paramiko.sftp_client.CMD_CLOSE=paramiko.sftp_client-module.html#CMD_CLOSE,Variable paramiko.sftp_file.CMD_CLOSE=paramiko.sftp_file-module.html#CMD_CLOSE,Variable paramiko.sftp_handle.CMD_CLOSE=paramiko.sftp_handle-module.html#CMD_CLOSE,Variable paramiko.sftp_server.CMD_CLOSE=paramiko.sftp_server-module.html#CMD_CLOSE,Variable paramiko.sftp_si.CMD_CLOSE=paramiko.sftp_si-module.html#CMD_CLOSE"><a title="paramiko.sftp.CMD_CLOSE +<a name="L78"></a><tt class="py-lineno"> 78</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="paramiko.sftp" class="py-name" href="#" onclick="return doclink('link-21', 'sftp', 'link-3');">sftp</a></tt><tt class="py-op">.</tt><tt class="py-name">_async_request</tt><tt class="py-op">(</tt><tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt id="link-22" class="py-name" targets="Variable paramiko.sftp.CMD_CLOSE=paramiko.sftp-module.html#CMD_CLOSE,Variable paramiko.sftp_attr.CMD_CLOSE=paramiko.sftp_attr-module.html#CMD_CLOSE,Variable paramiko.sftp_client.CMD_CLOSE=paramiko.sftp_client-module.html#CMD_CLOSE,Variable paramiko.sftp_file.CMD_CLOSE=paramiko.sftp_file-module.html#CMD_CLOSE,Variable paramiko.sftp_handle.CMD_CLOSE=paramiko.sftp_handle-module.html#CMD_CLOSE,Variable paramiko.sftp_server.CMD_CLOSE=paramiko.sftp_server-module.html#CMD_CLOSE,Variable paramiko.sftp_si.CMD_CLOSE=paramiko.sftp_si-module.html#CMD_CLOSE"><a title="paramiko.sftp.CMD_CLOSE paramiko.sftp_attr.CMD_CLOSE paramiko.sftp_client.CMD_CLOSE paramiko.sftp_file.CMD_CLOSE @@ -223,11 +224,11 @@ paramiko.sftp_server.CMD_CLOSE paramiko.sftp_si.CMD_CLOSE" class="py-name" href="#" onclick="return doclink('link-24', 'CMD_CLOSE', 'link-22');">CMD_CLOSE</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">handle</tt><tt class="py-op">)</tt> </tt> <a name="L81"></a><tt class="py-lineno"> 81</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">EOFError</tt><tt class="py-op">:</tt> </tt> <a name="L82"></a><tt class="py-lineno"> 82</tt> <tt class="py-line"> <tt class="py-comment"># may have outlived the Transport connection</tt> </tt> -<a name="L83"></a><tt class="py-lineno"> 83</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">pass</tt> </tt> +<a name="L83"></a><tt class="py-lineno"> 83</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt> <a name="L84"></a><tt class="py-lineno"> 84</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-op">(</tt><tt class="py-name">IOError</tt><tt class="py-op">,</tt> <tt class="py-name">socket</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Class paramiko.rng_posix.error=paramiko.rng_posix.error-class.html,Class paramiko.rng_win32.error=paramiko.rng_win32.error-class.html"><a title="paramiko.rng_posix.error paramiko.rng_win32.error" class="py-name" href="#" onclick="return doclink('link-25', 'error', 'link-25');">error</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> <a name="L85"></a><tt class="py-lineno"> 85</tt> <tt class="py-line"> <tt class="py-comment"># may have outlived the Transport connection</tt> </tt> -<a name="L86"></a><tt class="py-lineno"> 86</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">pass</tt> </tt> +<a name="L86"></a><tt class="py-lineno"> 86</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt> </div><a name="L87"></a><tt class="py-lineno"> 87</tt> <tt class="py-line"> </tt> <a name="SFTPFile._data_in_prefetch_requests"></a><div id="SFTPFile._data_in_prefetch_requests-def"><a name="L88"></a><tt class="py-lineno"> 88</tt> <a class="py-toggle" href="#" id="SFTPFile._data_in_prefetch_requests-toggle" onclick="return toggle('SFTPFile._data_in_prefetch_requests');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="paramiko.sftp_file.SFTPFile-class.html#_data_in_prefetch_requests">_data_in_prefetch_requests</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">offset</tt><tt class="py-op">,</tt> <tt class="py-param">size</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> </div><div id="SFTPFile._data_in_prefetch_requests-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SFTPFile._data_in_prefetch_requests-expanded"><a name="L89"></a><tt class="py-lineno"> 89</tt> <tt class="py-line"> <tt class="py-name">k</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">i</tt> <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_prefetch_reads</tt> <tt class="py-keyword">if</tt> <tt class="py-name">i</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op"><=</tt> <tt class="py-name">offset</tt><tt class="py-op">]</tt> </tt> @@ -237,12 +238,12 @@ paramiko.rng_win32.error" class="py-name" href="#" onclick="return doclink('link <a name="L93"></a><tt class="py-lineno"> 93</tt> <tt class="py-line"> <tt class="py-name">buf_offset</tt><tt class="py-op">,</tt> <tt class="py-name">buf_size</tt> <tt class="py-op">=</tt> <tt class="py-name">k</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt> <a name="L94"></a><tt class="py-lineno"> 94</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">buf_offset</tt> <tt class="py-op">+</tt> <tt class="py-name">buf_size</tt> <tt class="py-op"><=</tt> <tt class="py-name">offset</tt><tt class="py-op">:</tt> </tt> <a name="L95"></a><tt class="py-lineno"> 95</tt> <tt class="py-line"> <tt class="py-comment"># prefetch request ends before this one begins</tt> </tt> -<a name="L96"></a><tt class="py-lineno"> 96</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt> +<a name="L96"></a><tt class="py-lineno"> 96</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt> <a name="L97"></a><tt class="py-lineno"> 97</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">buf_offset</tt> <tt class="py-op">+</tt> <tt class="py-name">buf_size</tt> <tt class="py-op">>=</tt> <tt class="py-name">offset</tt> <tt class="py-op">+</tt> <tt class="py-name">size</tt><tt class="py-op">:</tt> </tt> <a name="L98"></a><tt class="py-lineno"> 98</tt> <tt class="py-line"> <tt class="py-comment"># inclusive</tt> </tt> -<a name="L99"></a><tt class="py-lineno"> 99</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt> +<a name="L99"></a><tt class="py-lineno"> 99</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt> <a name="L100"></a><tt class="py-lineno">100</tt> <tt class="py-line"> <tt class="py-comment"># well, we have part of the request. see if another chunk has the rest.</tt> </tt> -<a name="L101"></a><tt class="py-lineno">101</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_in_prefetch_requests</tt><tt class="py-op">(</tt><tt class="py-name">buf_offset</tt> <tt class="py-op">+</tt> <tt class="py-name">buf_size</tt><tt class="py-op">,</tt> <tt class="py-name">offset</tt> <tt class="py-op">+</tt> <tt class="py-name">size</tt> <tt class="py-op">-</tt> <tt class="py-name">buf_offset</tt> <tt class="py-op">-</tt> <tt class="py-name">buf_size</tt><tt class="py-op">)</tt> </tt> +<a name="L101"></a><tt class="py-lineno">101</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_in_prefetch_requests</tt><tt class="py-op">(</tt><tt class="py-name">buf_offset</tt> <tt class="py-op">+</tt> <tt class="py-name">buf_size</tt><tt class="py-op">,</tt> <tt class="py-name">offset</tt> <tt class="py-op">+</tt> <tt class="py-name">size</tt> <tt class="py-op">-</tt> <tt class="py-name">buf_offset</tt> <tt class="py-op">-</tt> <tt class="py-name">buf_size</tt><tt class="py-op">)</tt> </tt> </div><a name="L102"></a><tt class="py-lineno">102</tt> <tt class="py-line"> </tt> <a name="SFTPFile._data_in_prefetch_buffers"></a><div id="SFTPFile._data_in_prefetch_buffers-def"><a name="L103"></a><tt class="py-lineno">103</tt> <a class="py-toggle" href="#" id="SFTPFile._data_in_prefetch_buffers-toggle" onclick="return toggle('SFTPFile._data_in_prefetch_buffers');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="paramiko.sftp_file.SFTPFile-class.html#_data_in_prefetch_buffers">_data_in_prefetch_buffers</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">offset</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> </div><div id="SFTPFile._data_in_prefetch_buffers-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SFTPFile._data_in_prefetch_buffers-expanded"><a name="L104"></a><tt class="py-lineno">104</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt> @@ -258,7 +259,7 @@ paramiko.rng_win32.error" class="py-name" href="#" onclick="return doclink('link <a name="L114"></a><tt class="py-lineno">114</tt> <tt class="py-line"> <tt class="py-name">buf_offset</tt> <tt class="py-op">=</tt> <tt class="py-name">offset</tt> <tt class="py-op">-</tt> <tt class="py-name">index</tt> </tt> <a name="L115"></a><tt class="py-lineno">115</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">buf_offset</tt> <tt class="py-op">>=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_prefetch_data</tt><tt class="py-op">[</tt><tt class="py-name">index</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> <a name="L116"></a><tt class="py-lineno">116</tt> <tt class="py-line"> <tt class="py-comment"># it's not here</tt> </tt> -<a name="L117"></a><tt class="py-lineno">117</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt> +<a name="L117"></a><tt class="py-lineno">117</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt> <a name="L118"></a><tt class="py-lineno">118</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">index</tt> </tt> </div><a name="L119"></a><tt class="py-lineno">119</tt> <tt class="py-line"> </tt> <a name="SFTPFile._read_prefetch"></a><div id="SFTPFile._read_prefetch-def"><a name="L120"></a><tt class="py-lineno">120</tt> <a class="py-toggle" href="#" id="SFTPFile._read_prefetch-toggle" onclick="return toggle('SFTPFile._read_prefetch');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="paramiko.sftp_file.SFTPFile-class.html#_read_prefetch">_read_prefetch</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">size</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> @@ -267,7 +268,7 @@ paramiko.rng_win32.error" class="py-name" href="#" onclick="return doclink('link <a name="L123"></a><tt class="py-lineno">123</tt> <tt class="py-line"><tt class="py-docstring"> in the buffer, return None. otherwise, behaves like a normal read.</tt> </tt> <a name="L124"></a><tt class="py-lineno">124</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt> <a name="L125"></a><tt class="py-lineno">125</tt> <tt class="py-line"> <tt class="py-comment"># while not closed, and haven't fetched past the current position, and haven't reached EOF...</tt> </tt> -<a name="L126"></a><tt class="py-lineno">126</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt> +<a name="L126"></a><tt class="py-lineno">126</tt> <tt class="py-line"> <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt> <a name="L127"></a><tt class="py-lineno">127</tt> <tt class="py-line"> <tt class="py-name">offset</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_in_prefetch_buffers</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_realpos</tt><tt class="py-op">)</tt> </tt> <a name="L128"></a><tt class="py-lineno">128</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">offset</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt> <a name="L129"></a><tt class="py-lineno">129</tt> <tt class="py-line"> <tt class="py-keyword">break</tt> </tt> @@ -315,7 +316,7 @@ paramiko.sftp_si.CMD_DATA" class="py-name" href="#" onclick="return doclink('lin </div><a name="L159"></a><tt class="py-lineno">159</tt> <tt class="py-line"> </tt> <a name="SFTPFile._write"></a><div id="SFTPFile._write-def"><a name="L160"></a><tt class="py-lineno">160</tt> <a class="py-toggle" href="#" id="SFTPFile._write-toggle" onclick="return toggle('SFTPFile._write');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="paramiko.sftp_file.SFTPFile-class.html#_write">_write</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> </div><div id="SFTPFile._write-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SFTPFile._write-expanded"><a name="L161"></a><tt class="py-lineno">161</tt> <tt class="py-line"> <tt class="py-comment"># may write less than requested if it would exceed max packet size</tt> </tt> -<a name="L162"></a><tt class="py-lineno">162</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">chunk</tt> <tt class="py-op">=</tt> <tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name"><a title="paramiko.SFTPFile.MAX_REQUEST_SIZE" class="py-name" href="#" onclick="return doclink('link-43', 'MAX_REQUEST_SIZE', 'link-10');">MAX_REQUEST_SIZE</a></tt><tt class="py-op">)</tt> </tt> +<a name="L162"></a><tt class="py-lineno">162</tt> <tt class="py-line"> <tt class="py-name">chunk</tt> <tt class="py-op">=</tt> <tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name"><a title="paramiko.SFTPFile.MAX_REQUEST_SIZE" class="py-name" href="#" onclick="return doclink('link-43', 'MAX_REQUEST_SIZE', 'link-10');">MAX_REQUEST_SIZE</a></tt><tt class="py-op">)</tt> </tt> <a name="L163"></a><tt class="py-lineno">163</tt> <tt class="py-line"> <tt class="py-name">req</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-44" class="py-name"><a title="paramiko.sftp" class="py-name" href="#" onclick="return doclink('link-44', 'sftp', 'link-3');">sftp</a></tt><tt class="py-op">.</tt><tt class="py-name">_async_request</tt><tt class="py-op">(</tt><tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt id="link-45" class="py-name" targets="Variable paramiko.sftp.CMD_WRITE=paramiko.sftp-module.html#CMD_WRITE,Variable paramiko.sftp_attr.CMD_WRITE=paramiko.sftp_attr-module.html#CMD_WRITE,Variable paramiko.sftp_client.CMD_WRITE=paramiko.sftp_client-module.html#CMD_WRITE,Variable paramiko.sftp_file.CMD_WRITE=paramiko.sftp_file-module.html#CMD_WRITE,Variable paramiko.sftp_handle.CMD_WRITE=paramiko.sftp_handle-module.html#CMD_WRITE,Variable paramiko.sftp_server.CMD_WRITE=paramiko.sftp_server-module.html#CMD_WRITE,Variable paramiko.sftp_si.CMD_WRITE=paramiko.sftp_si-module.html#CMD_WRITE"><a title="paramiko.sftp.CMD_WRITE paramiko.sftp_attr.CMD_WRITE paramiko.sftp_client.CMD_WRITE @@ -334,7 +335,7 @@ paramiko.sftp_server.CMD_STATUS paramiko.sftp_si.CMD_STATUS" class="py-name" href="#" onclick="return doclink('link-49', 'CMD_STATUS', 'link-49');">CMD_STATUS</a></tt><tt class="py-op">:</tt> </tt> <a name="L167"></a><tt class="py-lineno">167</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt id="link-50" class="py-name"><a title="paramiko.SFTPError" class="py-name" href="#" onclick="return doclink('link-50', 'SFTPError', 'link-41');">SFTPError</a></tt><tt class="py-op">(</tt><tt class="py-string">'Expected status'</tt><tt class="py-op">)</tt> </tt> <a name="L168"></a><tt class="py-lineno">168</tt> <tt class="py-line"> <tt class="py-comment"># convert_status already called</tt> </tt> -<a name="L169"></a><tt class="py-lineno">169</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">return</tt> <tt class="py-name">chunk</tt> </tt> +<a name="L169"></a><tt class="py-lineno">169</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">chunk</tt> </tt> </div><a name="L170"></a><tt class="py-lineno">170</tt> <tt class="py-line"> </tt> <a name="SFTPFile.settimeout"></a><div id="SFTPFile.settimeout-def"><a name="L171"></a><tt class="py-lineno">171</tt> <a class="py-toggle" href="#" id="SFTPFile.settimeout-toggle" onclick="return toggle('SFTPFile.settimeout');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="paramiko.sftp_file.SFTPFile-class.html#settimeout">settimeout</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">timeout</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> </div><div id="SFTPFile.settimeout-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SFTPFile.settimeout-expanded"><a name="L172"></a><tt class="py-lineno">172</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt> @@ -682,7 +683,7 @@ paramiko.SFTPFile.stat paramiko.SFTPHandle.stat paramiko.SFTPServerInterface.stat" class="py-name" href="#" onclick="return doclink('link-90', 'stat', 'link-90');">stat</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">st_size</tt> </tt> <a name="L384"></a><tt class="py-lineno">384</tt> <tt class="py-line"> <tt class="py-comment"># queue up async reads for the rest of the file</tt> </tt> -<a name="L385"></a><tt class="py-lineno">385</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">chunks</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt> +<a name="L385"></a><tt class="py-lineno">385</tt> <tt class="py-line"> <tt class="py-name">chunks</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt> <a name="L386"></a><tt class="py-lineno">386</tt> <tt class="py-line"> <tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_realpos</tt> </tt> <a name="L387"></a><tt class="py-lineno">387</tt> <tt class="py-line"> <tt class="py-keyword">while</tt> <tt class="py-name">n</tt> <tt class="py-op"><</tt> <tt class="py-name">size</tt><tt class="py-op">:</tt> </tt> <a name="L388"></a><tt class="py-lineno">388</tt> <tt class="py-line"> <tt class="py-name">chunk</tt> <tt class="py-op">=</tt> <tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-91" class="py-name"><a title="paramiko.SFTPFile.MAX_REQUEST_SIZE" class="py-name" href="#" onclick="return doclink('link-91', 'MAX_REQUEST_SIZE', 'link-10');">MAX_REQUEST_SIZE</a></tt><tt class="py-op">,</tt> <tt class="py-name">size</tt> <tt class="py-op">-</tt> <tt class="py-name">n</tt><tt class="py-op">)</tt> </tt> @@ -732,11 +733,11 @@ paramiko.util.DEBUG" class="py-name" href="#" onclick="return doclink('link-93', <a name="L411"></a><tt class="py-lineno">411</tt> <tt class="py-line"> <tt class="py-name">read_chunks</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt> <a name="L412"></a><tt class="py-lineno">412</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">offset</tt><tt class="py-op">,</tt> <tt class="py-name">size</tt> <tt class="py-keyword">in</tt> <tt class="py-name">chunks</tt><tt class="py-op">:</tt> </tt> <a name="L413"></a><tt class="py-lineno">413</tt> <tt class="py-line"> <tt class="py-comment"># don't fetch data that's already in the prefetch buffer</tt> </tt> -<a name="L414"></a><tt class="py-lineno">414</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_in_prefetch_buffers</tt><tt class="py-op">(</tt><tt class="py-name">offset</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_in_prefetch_requests</tt><tt class="py-op">(</tt><tt class="py-name">offset</tt><tt class="py-op">,</tt> <tt class="py-name">size</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> +<a name="L414"></a><tt class="py-lineno">414</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_in_prefetch_buffers</tt><tt class="py-op">(</tt><tt class="py-name">offset</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_in_prefetch_requests</tt><tt class="py-op">(</tt><tt class="py-name">offset</tt><tt class="py-op">,</tt> <tt class="py-name">size</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> <a name="L415"></a><tt class="py-lineno">415</tt> <tt class="py-line"> <tt class="py-keyword">continue</tt> </tt> <a name="L416"></a><tt class="py-lineno">416</tt> <tt class="py-line"> </tt> <a name="L417"></a><tt class="py-lineno">417</tt> <tt class="py-line"> <tt class="py-comment"># break up anything larger than the max read size</tt> </tt> -<a name="L418"></a><tt class="py-lineno">418</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">while</tt> <tt class="py-name">size</tt> <tt class="py-op">></tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt> +<a name="L418"></a><tt class="py-lineno">418</tt> <tt class="py-line"> <tt class="py-keyword">while</tt> <tt class="py-name">size</tt> <tt class="py-op">></tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt> <a name="L419"></a><tt class="py-lineno">419</tt> <tt class="py-line"> <tt class="py-name">chunk_size</tt> <tt class="py-op">=</tt> <tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">size</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-94" class="py-name"><a title="paramiko.SFTPFile.MAX_REQUEST_SIZE" class="py-name" href="#" onclick="return doclink('link-94', 'MAX_REQUEST_SIZE', 'link-10');">MAX_REQUEST_SIZE</a></tt><tt class="py-op">)</tt> </tt> <a name="L420"></a><tt class="py-lineno">420</tt> <tt class="py-line"> <tt class="py-name">read_chunks</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">offset</tt><tt class="py-op">,</tt> <tt class="py-name">chunk_size</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt> <a name="L421"></a><tt class="py-lineno">421</tt> <tt class="py-line"> <tt class="py-name">offset</tt> <tt class="py-op">+=</tt> <tt class="py-name">chunk_size</tt> </tt> @@ -744,7 +745,7 @@ paramiko.util.DEBUG" class="py-name" href="#" onclick="return doclink('link-93', <a name="L423"></a><tt class="py-lineno">423</tt> <tt class="py-line"> </tt> <a name="L424"></a><tt class="py-lineno">424</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_start_prefetch</tt><tt class="py-op">(</tt><tt class="py-name">read_chunks</tt><tt class="py-op">)</tt> </tt> <a name="L425"></a><tt class="py-lineno">425</tt> <tt class="py-line"> <tt class="py-comment"># now we can just devolve to a bunch of read()s :)</tt> </tt> -<a name="L426"></a><tt class="py-lineno">426</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">for</tt> <tt class="py-name">x</tt> <tt class="py-keyword">in</tt> <tt class="py-name">chunks</tt><tt class="py-op">:</tt> </tt> +<a name="L426"></a><tt class="py-lineno">426</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">x</tt> <tt class="py-keyword">in</tt> <tt class="py-name">chunks</tt><tt class="py-op">:</tt> </tt> <a name="L427"></a><tt class="py-lineno">427</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-95" class="py-name" targets="Method paramiko.BufferedFile.seek()=paramiko.BufferedFile-class.html#seek,Method paramiko.SFTPFile.seek()=paramiko.SFTPFile-class.html#seek"><a title="paramiko.BufferedFile.seek paramiko.SFTPFile.seek" class="py-name" href="#" onclick="return doclink('link-95', 'seek', 'link-95');">seek</a></tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt> <a name="L428"></a><tt class="py-lineno">428</tt> <tt class="py-line"> <tt class="py-keyword">yield</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-96" class="py-name" targets="Method paramiko.BufferedFile.read()=paramiko.BufferedFile-class.html#read,Method paramiko.SFTPHandle.read()=paramiko.SFTPHandle-class.html#read,Method paramiko.buffered_pipe.BufferedPipe.read()=paramiko.buffered_pipe.BufferedPipe-class.html#read"><a title="paramiko.BufferedFile.read @@ -753,7 +754,7 @@ paramiko.buffered_pipe.BufferedPipe.read" class="py-name" href="#" onclick="retu </div><a name="L429"></a><tt class="py-lineno">429</tt> <tt class="py-line"> </tt> <a name="L430"></a><tt class="py-lineno">430</tt> <tt class="py-line"> </tt> <a name="L431"></a><tt class="py-lineno">431</tt> <tt class="py-line"> <tt class="py-comment">### internals...</tt> </tt> -<a name="L432"></a><tt class="py-lineno">432</tt> <tt class="py-line"><tt class="py-comment"></tt> </tt> +<a name="L432"></a><tt class="py-lineno">432</tt> <tt class="py-line"> </tt> <a name="L433"></a><tt class="py-lineno">433</tt> <tt class="py-line"> </tt> <a name="SFTPFile._get_size"></a><div id="SFTPFile._get_size-def"><a name="L434"></a><tt class="py-lineno">434</tt> <a class="py-toggle" href="#" id="SFTPFile._get_size-toggle" onclick="return toggle('SFTPFile._get_size');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="paramiko.sftp_file.SFTPFile-class.html#_get_size">_get_size</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> </div><div id="SFTPFile._get_size-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SFTPFile._get_size-expanded"><a name="L435"></a><tt class="py-lineno">435</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt> @@ -775,8 +776,8 @@ paramiko.SFTPServerInterface.stat" class="py-name" href="#" onclick="return docl </div><a name="L448"></a><tt class="py-lineno">448</tt> <tt class="py-line"> </tt> <a name="SFTPFile._prefetch_thread"></a><div id="SFTPFile._prefetch_thread-def"><a name="L449"></a><tt class="py-lineno">449</tt> <a class="py-toggle" href="#" id="SFTPFile._prefetch_thread-toggle" onclick="return toggle('SFTPFile._prefetch_thread');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="paramiko.sftp_file.SFTPFile-class.html#_prefetch_thread">_prefetch_thread</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">chunks</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> </div><div id="SFTPFile._prefetch_thread-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SFTPFile._prefetch_thread-expanded"><a name="L450"></a><tt class="py-lineno">450</tt> <tt class="py-line"> <tt class="py-comment"># do these read requests in a temporary thread because there may be</tt> </tt> -<a name="L451"></a><tt class="py-lineno">451</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># a lot of them, so it may block.</tt> </tt> -<a name="L452"></a><tt class="py-lineno">452</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">for</tt> <tt class="py-name">offset</tt><tt class="py-op">,</tt> <tt class="py-name">length</tt> <tt class="py-keyword">in</tt> <tt class="py-name">chunks</tt><tt class="py-op">:</tt> </tt> +<a name="L451"></a><tt class="py-lineno">451</tt> <tt class="py-line"> <tt class="py-comment"># a lot of them, so it may block.</tt> </tt> +<a name="L452"></a><tt class="py-lineno">452</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">offset</tt><tt class="py-op">,</tt> <tt class="py-name">length</tt> <tt class="py-keyword">in</tt> <tt class="py-name">chunks</tt><tt class="py-op">:</tt> </tt> <a name="L453"></a><tt class="py-lineno">453</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-98" class="py-name"><a title="paramiko.sftp" class="py-name" href="#" onclick="return doclink('link-98', 'sftp', 'link-3');">sftp</a></tt><tt class="py-op">.</tt><tt class="py-name">_async_request</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-99" class="py-name"><a title="paramiko.sftp.CMD_READ paramiko.sftp_attr.CMD_READ paramiko.sftp_client.CMD_READ @@ -794,7 +795,7 @@ paramiko.sftp_handle.CMD_STATUS paramiko.sftp_server.CMD_STATUS paramiko.sftp_si.CMD_STATUS" class="py-name" href="#" onclick="return doclink('link-100', 'CMD_STATUS', 'link-49');">CMD_STATUS</a></tt><tt class="py-op">:</tt> </tt> <a name="L457"></a><tt class="py-lineno">457</tt> <tt class="py-line"> <tt class="py-comment"># save exception and re-raise it on next file operation</tt> </tt> -<a name="L458"></a><tt class="py-lineno">458</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt> +<a name="L458"></a><tt class="py-lineno">458</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt> <a name="L459"></a><tt class="py-lineno">459</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-101" class="py-name"><a title="paramiko.sftp" class="py-name" href="#" onclick="return doclink('link-101', 'sftp', 'link-3');">sftp</a></tt><tt class="py-op">.</tt><tt class="py-name">_convert_status</tt><tt class="py-op">(</tt><tt class="py-name">msg</tt><tt class="py-op">)</tt> </tt> <a name="L460"></a><tt class="py-lineno">460</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">x</tt><tt class="py-op">:</tt> </tt> <a name="L461"></a><tt class="py-lineno">461</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_saved_exception</tt> <tt class="py-op">=</tt> <tt class="py-name">x</tt> </tt> @@ -852,7 +853,7 @@ expandto(location.href); <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> - Generated by Epydoc 3.0.1 on Sun Jul 6 18:30:36 2008 + Generated by Epydoc 3.0.1 on Sun Nov 1 22:14:20 2009 </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" |