summaryrefslogtreecommitdiff
path: root/wsgitools/middlewares.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2007-04-15 18:14:57 +0200
committerHelmut Grohne <helmut@subdivi.de>2007-04-15 18:14:57 +0200
commit0b08dacfcfced7fef1b4818a73c3f43a97fe8c8f (patch)
tree1841f9a4c97faa3d5df147fdc6ebfe95e9b181e6 /wsgitools/middlewares.py
parentd6b64ecb5bfb6d49ca8e97f58e3ad65075810269 (diff)
downloadwsgitools-0b08dacfcfced7fef1b4818a73c3f43a97fe8c8f.tar.gz
added docstrings
Diffstat (limited to 'wsgitools/middlewares.py')
-rw-r--r--wsgitools/middlewares.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/wsgitools/middlewares.py b/wsgitools/middlewares.py
index 17afd76..5ff610f 100644
--- a/wsgitools/middlewares.py
+++ b/wsgitools/middlewares.py
@@ -11,10 +11,12 @@ except ImportError:
__all__.append("SubdirMiddleware")
class SubdirMiddleware:
+ """Middleware choosing wsgi applications based on a dict."""
def __init__(self, default, mapping={}):
self.default = default
self.mapping = mapping
def __call__(self, environ, start_response):
+ """wsgi interface"""
app = None
script = environ["PATH_INFO"]
path_info = ""
@@ -219,9 +221,13 @@ class CachingMiddleware:
__all__.append("DictAuthChecker")
class DictAuthChecker:
+ """Verifies usernames and passwords by looking them up in a dict."""
def __init__(self, users):
+ """users is a dict mapping usernames to password."""
self.users = users
def __call__(self, username, password):
+ """check_function interface taking username and password and resulting
+ in a bool."""
return username in self.users and self.users[username] == password
__all__.append("BasicAuthMiddleware")