From 945a41dd3d2cf7f3d37012c588d8eb07bcc296b2 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Tue, 6 Apr 2004 08:16:02 +0000 Subject: [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. --- demo_server.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'demo_server.py') diff --git a/demo_server.py b/demo_server.py index 6447d4a0..5d6cbb5c 100755 --- a/demo_server.py +++ b/demo_server.py @@ -1,16 +1,10 @@ #!/usr/bin/python -import sys, os, socket, threading, logging, traceback, base64 +import sys, os, socket, threading, traceback, base64 import paramiko # setup logging -l = logging.getLogger("paramiko") -l.setLevel(logging.DEBUG) -if len(l.handlers) == 0: - f = open('demo_server.log', 'w') - lh = logging.StreamHandler(f) - lh.setFormatter(logging.Formatter('%(levelname)-.3s [%(asctime)s] %(name)s: %(message)s', '%Y%m%d:%H%M%S')) - l.addHandler(lh) +paramiko.util.log_to_file('demo_server.log') #host_key = paramiko.RSAKey() #host_key.read_private_key_file('demo_rsa_key') -- cgit v1.2.3