From 0b08dacfcfced7fef1b4818a73c3f43a97fe8c8f Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 15 Apr 2007 18:14:57 +0200 Subject: added docstrings --- wsgitools/middlewares.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'wsgitools/middlewares.py') 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") -- cgit v1.2.3