Mercurial > mozilla > hg > talosnames
comparison talosnames/web.py @ 66:0f5c22c07146
add interface for paste since wsgiref falls over in production
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 20 Aug 2012 09:49:18 -0700 |
parents | 08422429b181 |
children | 6e495bad69bb |
comparison
equal
deleted
inserted
replaced
65:22c35af93ef8 | 66:0f5c22c07146 |
---|---|
139 """returns template path""" | 139 """returns template path""" |
140 path = path.strip('/') | 140 path = path.strip('/') |
141 template = self.paths.get(path, 'index.html') | 141 template = self.paths.get(path, 'index.html') |
142 return os.path.join(here, 'templates', template) | 142 return os.path.join(here, 'templates', template) |
143 | 143 |
144 def paste_factory(global_conf, **app_conf): | |
145 """factory interface for paste""" | |
146 app = Handler(**app_conf) | |
147 return app | |
148 | |
144 def main(args=sys.argv[1:]): | 149 def main(args=sys.argv[1:]): |
150 """CLI entry point""" | |
151 | |
145 parser = optparse.OptionParser() | 152 parser = optparse.OptionParser() |
146 parser.add_option('-o', '--output', dest='output', | 153 parser.add_option('-o', '--output', dest='output', |
147 help="file to output to") | 154 help="file to output to") |
148 parser.add_option('-p', '--port', dest='port', | 155 parser.add_option('-p', '--port', dest='port', |
149 default=8080, type='int', | 156 default=8080, type='int', |