Mercurial > mozilla > hg > talosnames
comparison talosnames/web.py @ 35:88d280049e2f
stub parsing options
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 23 Jul 2012 13:57:14 -0700 |
parents | 1a9ec766f2b0 |
children | c945731f06d0 |
comparison
equal
deleted
inserted
replaced
34:b51b0d750086 | 35:88d280049e2f |
---|---|
2 | 2 |
3 """ | 3 """ |
4 web handler for talosnames | 4 web handler for talosnames |
5 """ | 5 """ |
6 | 6 |
7 import optparse | |
7 import os | 8 import os |
8 import pprint | 9 import pprint |
9 import tempita | 10 import tempita |
10 from api import TalosNames | 11 from api import TalosNames |
11 from subprocess import list2cmdline | 12 from subprocess import list2cmdline |
71 contents = file(template).read() | 72 contents = file(template).read() |
72 _template = tempita.HTMLTemplate(contents) | 73 _template = tempita.HTMLTemplate(contents) |
73 return _template.substitute(self.data) | 74 return _template.substitute(self.data) |
74 | 75 |
75 if __name__ == '__main__': | 76 if __name__ == '__main__': |
77 | |
78 parser = optparse.OptionParser() | |
79 options, args = parser.parse_args() | |
80 | |
76 from wsgiref import simple_server | 81 from wsgiref import simple_server |
77 app = Handler() | 82 app = Handler() |
78 server = simple_server.make_server(host='0.0.0.0', port=8080, app=app) | 83 server = simple_server.make_server(host='0.0.0.0', port=8080, app=app) |
79 server.serve_forever() | 84 server.serve_forever() |
80 | 85 |