python: Escape \n in long_description

This commit is contained in:
Tatsuhiro Tsujikawa 2012-08-28 23:00:24 +09:00
parent adbf33c0b8
commit 3d694c89c5
1 changed files with 4 additions and 4 deletions

View File

@ -113,16 +113,16 @@ Here is a simple SPDY client::
class MyStreamHandler(spdylay.BaseSPDYStreamHandler):
def on_header(self, nv):
sys.stdout.write('Stream#{}\n'.format(self.stream_id))
sys.stdout.write('Stream#{}\\n'.format(self.stream_id))
for k, v in nv:
sys.stdout.write('{}: {}\n'.format(k, v))
sys.stdout.write('{}: {}\\n'.format(k, v))
def on_data(self, data):
sys.stdout.write('Stream#{}\n'.format(self.stream_id))
sys.stdout.write('Stream#{}\\n'.format(self.stream_id))
sys.stdout.buffer.write(data)
def on_close(self, status_code):
sys.stdout.write('Stream#{} closed\n'.format(self.stream_id))
sys.stdout.write('Stream#{} closed\\n'.format(self.stream_id))
if __name__ == '__main__':
uris = sys.argv[1:]