From e299181a5dda25aed4879ebcbe1359604448b3ae Mon Sep 17 00:00:00 2001 From: "Jeremy T. Bouse" Date: Fri, 27 Nov 2009 16:25:55 -0500 Subject: Imported Upstream version 1.7.6 --- docs/paramiko.sftp-pysrc.html | 70 +++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'docs/paramiko.sftp-pysrc.html') diff --git a/docs/paramiko.sftp-pysrc.html b/docs/paramiko.sftp-pysrc.html index a1b987c..c948e27 100644 --- a/docs/paramiko.sftp-pysrc.html +++ b/docs/paramiko.sftp-pysrc.html @@ -54,24 +54,24 @@

Source Code for Module paramiko.sftp

-  1  # Copyright (C) 2003-2007  Robey Pointer <robey@lag.net> 
-  2  # 
-  3  # This file is part of paramiko. 
-  4  # 
-  5  # Paramiko is free software; you can redistribute it and/or modify it under the 
-  6  # terms of the GNU Lesser General Public License as published by the Free 
-  7  # Software Foundation; either version 2.1 of the License, or (at your option) 
-  8  # any later version. 
-  9  # 
- 10  # Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY 
- 11  # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 
- 12  # A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more 
- 13  # details. 
- 14  # 
- 15  # You should have received a copy of the GNU Lesser General Public License 
- 16  # along with Paramiko; if not, write to the Free Software Foundation, Inc., 
- 17  # 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA. 
- 18   
+  1  # Copyright (C) 2003-2007  Robey Pointer <robeypointer@gmail.com> 
+  2  # 
+  3  # This file is part of paramiko. 
+  4  # 
+  5  # Paramiko is free software; you can redistribute it and/or modify it under the 
+  6  # terms of the GNU Lesser General Public License as published by the Free 
+  7  # Software Foundation; either version 2.1 of the License, or (at your option) 
+  8  # any later version. 
+  9  # 
+ 10  # Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY 
+ 11  # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 
+ 12  # A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more 
+ 13  # details. 
+ 14  # 
+ 15  # You should have received a copy of the GNU Lesser General Public License 
+ 16  # along with Paramiko; if not, write to the Free Software Foundation, Inc., 
+ 17  # 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA. 
+ 18   
  19  import select 
  20  import socket 
  21  import struct 
@@ -372,7 +372,7 @@ paramiko.sftp_si.SFTP_FLAG_EXCL" class="py-name" href="#" onclick="return doclin
  58   
  59   
  60  # for debugging 
- 61   61  101   
 102   
 103      ###  internals... 
-104   
+104   
 105   
 
106 - def _send_version(self):
107 self._send_packet(110 raise SFTPError('Incompatible sftp protocol') 111 version = struct.unpack('>I', data[:4])[0] 112 # if version != _VERSION: -113 # raise SFTPError('Incompatible sftp protocol') -114 return version +113 # raise SFTPError('Incompatible sftp protocol') +114 return version
115
116 - def _send_server_version(self):
117 # winscp will freak out if the server sends version info before the -118 # client finishes sending INIT. -119 t, data = self._read_packet() +118 # client finishes sending INIT. +119 t, data = self._read_packet() 120 if t != 121 raise SFTPError('Incompatible sftp protocol') 122 version = struct.unpack('>I', data[:4])[0] 123 # advertise that we support "check-file" -124 extension_pairs = [ 'check-file', 'md5,sha1' ] +124 extension_pairs = [ 'check-file', 'md5,sha1' ] 125 msg = Message() 126 msg.add_int(_VERSION) 127 msg.146 while n > 0: 147 if isinstance(self.sock, socket.socket): 148 # sometimes sftp is used directly over a socket instead of -149 # through a paramiko channel. in this case, check periodically -150 # if the socket is closed. (for some reason, recv() won't ever -151 # return or raise an exception, but calling select on a closed -152 # socket will.) -153 while True: +149 # through a paramiko channel. in this case, check periodically +150 # if the socket is closed. (for some reason, recv() won't ever +151 # return or raise an exception, but calling select on a closed +152 # socket will.) +153 while True: 154 read, 166
167 - def _send_packet(self, t, packet):
168 #self._log(DEBUG2, 'write: %s (len=%d)' % (CMD_NAMES.get(t, '0x%02x' % t), len(packet))) -169 out = struct.pack('>I', len(packet) + 1) + chr(t) + packet +169 out = struct.pack('>I', len(packet) + 1) + chr(t) + packet 170 if self.ultra_debug: 171 self._log(
174 - def _read_packet(self):
175 x = self._read_all(4) 176 # most sftp servers won't accept packets larger than about 32k, so -177 # anything with the high byte set (> 16MB) is just garbage. -178 if x[0] != '\x00': +177 # anything with the high byte set (> 16MB) is just garbage. +178 if x[0] != '\x00': 179 raise SFTPError('Garbage packet received') 180 size = struct.unpack('>I', x)[0] 181 data = self._read_all(size) @@ -741,7 +741,7 @@ paramiko.util.DEBUG" class="py-name" href="#" onclick="return doclink('link-110' 184 if size > 0: 185 t = ord(data[0]) 186 #self._log(DEBUG2, 'read: %s (len=%d)' % (CMD_NAMES.get(t), '0x%02x' % t, len(data)-1)) -187 return t, data[1:] +187 return t, data[1:] 188 return 0, ''
189