diff options
author | Robey Pointer <robey@lag.net> | 2004-04-06 08:16:02 +0000 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2004-04-06 08:16:02 +0000 |
commit | 945a41dd3d2cf7f3d37012c588d8eb07bcc296b2 (patch) | |
tree | 112de2889851b2515994cbaab42bf3f868d0939e /paramiko/sftp.py | |
parent | ed72847ad1e392af6bb8920176c30548c68ddb23 (diff) | |
download | paramiko-945a41dd3d2cf7f3d37012c588d8eb07bcc296b2.tar.gz |
[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-42]
support py22, more or less
add roger binns' patches for supporting python 2.2. i hedged a bit on the
logging stuff and just added some trickery to let logging be stubbed out for
python 2.2. this changed a lot of import statements but i managed to avoid
hacking at any of the existing logging.
socket timeouts are required for the threads to notice when they've been
deactivated. worked around it by using the 'select' module on py22.
also fixed the sftp unit tests to cope with a password-protected private key.
Diffstat (limited to 'paramiko/sftp.py')
-rw-r--r-- | paramiko/sftp.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/paramiko/sftp.py b/paramiko/sftp.py index 928a1342..9a26298b 100644 --- a/paramiko/sftp.py +++ b/paramiko/sftp.py @@ -18,11 +18,11 @@ # along with Foobar; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -import struct, logging, socket -from util import format_binary, tb_strings +import struct, socket +from common import * +import util from channel import Channel from message import Message -from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL from file import BufferedFile CMD_INIT, CMD_VERSION, CMD_OPEN, CMD_CLOSE, CMD_READ, CMD_WRITE, CMD_LSTAT, CMD_FSTAT, CMD_SETSTAT, \ @@ -511,14 +511,14 @@ class SFTP (object): def _send_packet(self, t, packet): out = struct.pack('>I', len(packet) + 1) + chr(t) + packet if self.ultra_debug: - self._log(DEBUG, format_binary(out, 'OUT: ')) + self._log(DEBUG, util.format_binary(out, 'OUT: ')) self._write_all(out) def _read_packet(self): size = struct.unpack('>I', self._read_all(4))[0] data = self._read_all(size) if self.ultra_debug: - self._log(DEBUG, format_binary(data, 'IN: ')); + self._log(DEBUG, util.format_binary(data, 'IN: ')); if size > 0: return ord(data[0]), data[1:] return 0, '' |