changeset 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 22c35af93ef8
children 277b167060e5
files paste.ini setup.py talosnames/web.py
diffstat 3 files changed, 30 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paste.ini	Mon Aug 20 09:49:18 2012 -0700
@@ -0,0 +1,21 @@
+#!/usr/bin/env paster
+
+[DEFAULT]
+debug = true
+email_to = jhammel@mozmilla.com
+smtp_server = localhost
+error_email_from = talosnames@localhost
+
+[server:main]
+use = egg:Paste#http
+host = 0.0.0.0
+port = 8080
+
+[composite:main]
+use = egg:Paste#urlmap
+/ = talosnames
+
+set debug = false
+
+[app:talosnames]
+paste.app_factory = talosnames.web:paste_factory
--- a/setup.py	Thu Aug 16 16:54:36 2012 -0700
+++ b/setup.py	Mon Aug 20 09:49:18 2012 -0700
@@ -5,7 +5,7 @@
 import os
 
 version = "0.0"
-dependencies = ['webob', 'CommandParser', 'talos', 'buildbot', 'PyYAML']
+dependencies = ['webob', 'CommandParser', 'talos', 'buildbot', 'PyYAML', 'PasteScript']
 
 try:
     import json
@@ -42,7 +42,7 @@
       author='Jeff Hammel',
       author_email='jhammel@mozilla.com',
       url='',
-      license='',
+      license='MPL',
       packages=['talosnames'],
       include_package_data=True,
       zip_safe=False,
--- a/talosnames/web.py	Thu Aug 16 16:54:36 2012 -0700
+++ b/talosnames/web.py	Mon Aug 20 09:49:18 2012 -0700
@@ -141,7 +141,14 @@
         template = self.paths.get(path, 'index.html')
         return os.path.join(here, 'templates', template)
 
+def paste_factory(global_conf, **app_conf):
+    """factory interface for paste"""
+    app = Handler(**app_conf)
+    return app
+
 def main(args=sys.argv[1:]):
+    """CLI entry point"""
+
     parser = optparse.OptionParser()
     parser.add_option('-o', '--output', dest='output',
                       help="file to output to")