changeset 31:6af220013aa1

example/persona.py setup.py
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 27 Dec 2013 12:13:18 -0800
parents 0bf52646061b
children f462dc131d57
files example/persona.py setup.py
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/example/persona.py
+++ b/example/persona.py
@@ -17,21 +17,28 @@ page = os.path.join(here, 'persona.html'
 class PersonaTest(object):
     def __init__(self, page=page):
         self.page = page
         assert os.path.exists(self.page), "File '%s' not found" % self.page
         self.page = open(self.page, 'r').read()
     def __call__(self, environ, start_response):
         method = environ['REQUEST_METHOD']
         if method == 'GET':
-            start_response("200 OK", [('Content-Type', 'text/html'),
-                                      ('Content-Length', str(len(self.page)))])
+            content_type = 'text/html'
             body = self.page
         elif method == 'POST':
-            body = '\n'.join([])
+            content_type = 'text/plain'
+            body = '\n'.join(['%s: %s' % (key, environ[key])
+                              for key in sorted(environ.keys())])
+            print body
+        else:
+            content_type = 'text/plain'
+            body = 'Try GET or POST to do something interesting (How did you get here?)'
+        start_response("200 OK", [('Content-Type', content_type),
+                                  ('Content-Length', str(len(body)))])
         return [body]
 
 def main(args=sys.argv[1:]):
 
     usage = '%prog [options]'
     parser = optparse.OptionParser(usage=usage, description=__doc__)
     parser.add_option('-p', '--port', dest='port',
                       type='int', default=8123,
--- a/setup.py
+++ b/setup.py
@@ -18,14 +18,12 @@ setup(name='bitsyauth',
       zip_safe=False,
       install_requires=['Paste',
                         'PasteScript',
                         'markup', # TO DEPRECATE
                         'skimpygimpy',
                         'PyBrowserID',
                         'WebOb',
                         ],
-      dependency_links=[
-                        'http://svn.pythonpaste.org/Paste/trunk#egg=Paste',
-                        ],
+      dependency_links=[],
       entry_points="""
       """,
       )