summaryrefslogtreecommitdiff
path: root/paste/auth
diff options
context:
space:
mode:
authorianb <devnull@localhost>2006-01-18 21:47:28 +0000
committerianb <devnull@localhost>2006-01-18 21:47:28 +0000
commit944b2ad40740d3788fcf13e7b2bca63211510653 (patch)
treece5f8ac6d742c2323355c3a593293ae256eb14b3 /paste/auth
parent7b128b31085d1847ebf7fbe34a6b2487d260cf7a (diff)
downloadpaste-944b2ad40740d3788fcf13e7b2bca63211510653.tar.gz
Indentation in docstring
Diffstat (limited to 'paste/auth')
-rw-r--r--paste/auth/cookie.py42
1 files changed, 22 insertions, 20 deletions
diff --git a/paste/auth/cookie.py b/paste/auth/cookie.py
index 4c4fb74..5c49905 100644
--- a/paste/auth/cookie.py
+++ b/paste/auth/cookie.py
@@ -16,26 +16,28 @@ Following is a very simple example where a form is presented asking for
a user name (no actual checking), and dummy session identifier (perhaps
corresponding to a database session id) is stored in the cookie.
->>> from paste.httpserver import serve
->>> from paste.fileapp import DataApp
->>> from paste.httpexceptions import *
->>> # from paste.auth.cookie import AuthCookiehandler
->>> from paste.wsgilib import parse_querystring
->>> def testapp(environ, start_response):
-... user = dict(parse_querystring(environ)).get('user','')
-... if user:
-... environ['REMOTE_USER'] = user
-... environ['REMOTE_SESSION'] = 'a-session-id'
-... if environ.get('REMOTE_USER'):
-... page = '<html><body>Welcome %s (%s)</body></html>'
-... page %= (environ['REMOTE_USER'], environ['REMOTE_SESSION'])
-... else:
-... page = ('<html><body><form><input name="user" />'
-... '<input type="submit" /></form></body></html>')
-... return DataApp(page, content_type="text/html")(
-... environ, start_response)
->>> serve(AuthCookieHandler(testapp))
-serving on...
+::
+
+ >>> from paste.httpserver import serve
+ >>> from paste.fileapp import DataApp
+ >>> from paste.httpexceptions import *
+ >>> # from paste.auth.cookie import AuthCookiehandler
+ >>> from paste.wsgilib import parse_querystring
+ >>> def testapp(environ, start_response):
+ ... user = dict(parse_querystring(environ)).get('user','')
+ ... if user:
+ ... environ['REMOTE_USER'] = user
+ ... environ['REMOTE_SESSION'] = 'a-session-id'
+ ... if environ.get('REMOTE_USER'):
+ ... page = '<html><body>Welcome %s (%s)</body></html>'
+ ... page %= (environ['REMOTE_USER'], environ['REMOTE_SESSION'])
+ ... else:
+ ... page = ('<html><body><form><input name="user" />'
+ ... '<input type="submit" /></form></body></html>')
+ ... return DataApp(page, content_type="text/html")(
+ ... environ, start_response)
+ >>> serve(AuthCookieHandler(testapp))
+ serving on...
"""