Commit 686dd5dd authored by Kirill Smelkov's avatar Kirill Smelkov

python: Make the program explicitly tell to outside this is Python version

We'll soon have several helloweb programs written in different languages
with otherwise the same output, and it is better to distinguish them for
diagnostic.
parent 88d51713
#!/usr/bin/env python
"""Simple web-server that says "Hello World" for every path
helloweb [--logfile <logfile>] <bind-ip> <bind-port> ...
helloweb.py [--logfile <logfile>] <bind-ip> <bind-port> ...
"""
import sys
......@@ -19,7 +19,7 @@ class WebHello(BaseHTTPRequestHandler):
self.end_headers()
print >>self.wfile, \
"Hello %s at `%s` ; %s" % (
"Hello %s at `%s` ; %s (python)" % (
' '.join(self.server.webhello_argv) or 'world',
self.path, time.asctime())
......@@ -41,7 +41,7 @@ def main():
f = open(args.logfile, 'a', buffering=1)
sys.stderr = f
print >>sys.stderr, '* %s helloweb starting at %s' % (
print >>sys.stderr, '* %s helloweb.py starting at %s' % (
time.asctime(), (args.bind_ip, args.bind_port))
# TODO autodetect ipv6/ipv4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment