summaryrefslogtreecommitdiffhomepage
path: root/demo_server.py
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2004-04-06 08:16:02 +0000
committerRobey Pointer <robey@lag.net>2004-04-06 08:16:02 +0000
commit945a41dd3d2cf7f3d37012c588d8eb07bcc296b2 (patch)
tree112de2889851b2515994cbaab42bf3f868d0939e /demo_server.py
parented72847ad1e392af6bb8920176c30548c68ddb23 (diff)
[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 'demo_server.py')
-rwxr-xr-xdemo_server.py10
1 files changed, 2 insertions, 8 deletions
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')