Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Commit

Permalink
make test printer more correct (print was inserting newlines)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnot committed Sep 8, 2010
1 parent e05a3ac commit 1aa9080
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,16 +380,20 @@ def idle_close():

def test_client(request_uri):
"A simple demonstration of a client."
import sys

def printer(version, status, phrase, headers, res_pause):
"Print the response headers."
print "HTTP/%s" % version, status, phrase
print "\n".join(["%s:%s" % header for header in headers])
print
def body(chunk):
print chunk
sys.stdout.write(chunk)
def done(err):
if err:
print "*** ERROR: %s (%s)" % (err['desc'], err['detail'])
sys.stderr.write("\n*** ERROR: %s (%s)\n" %
(err['desc'], err['detail'])
)
push_tcp.stop()
return body, done
c = Client(printer)
Expand Down

0 comments on commit 1aa9080

Please sign in to comment.