From 42f5ccf09799d3e475eb996b023a0daabae49cdb Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 6 Jan 2014 18:38:58 +0100 Subject: switch to new-style classes entirely There is no reason to use old-style classes beyond laziness. --- wsgitools/middlewares.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'wsgitools/middlewares.py') diff --git a/wsgitools/middlewares.py b/wsgitools/middlewares.py index 804d474..0f5e416 100644 --- a/wsgitools/middlewares.py +++ b/wsgitools/middlewares.py @@ -29,7 +29,7 @@ from wsgitools.authentication import AuthenticationRequired, \ ProtocolViolation, AuthenticationMiddleware __all__.append("SubdirMiddleware") -class SubdirMiddleware: +class SubdirMiddleware(object): """Middleware choosing wsgi applications based on a dict.""" def __init__(self, default, mapping={}): """ @@ -62,7 +62,7 @@ class SubdirMiddleware: return app(environ, start_response) __all__.append("NoWriteCallableMiddleware") -class NoWriteCallableMiddleware: +class NoWriteCallableMiddleware(object): """This middleware wraps a wsgi application that needs the return value of C{start_response} function to a wsgi application that doesn't need one by writing the data to a C{StringIO} and then making it be the first result @@ -129,7 +129,7 @@ class NoWriteCallableMiddleware: (data,), ret) __all__.append("ContentLengthMiddleware") -class ContentLengthMiddleware: +class ContentLengthMiddleware(object): """Guesses the content length header if possible. @note: The application used must not use the C{write} callable returned by C{start_response}.""" @@ -221,7 +221,7 @@ def cacheable(environ): return True __all__.append("CachingMiddleware") -class CachingMiddleware: +class CachingMiddleware(object): """Caches reponses to requests based on C{SCRIPT_NAME}, C{PATH_INFO} and C{QUERY_STRING}.""" def __init__(self, app, maxage=60, storable=storable, cacheable=cacheable): @@ -316,7 +316,7 @@ class CachingMiddleware: return CloseableIterator(getattr(ret, "close", None), pass_through()) __all__.append("DictAuthChecker") -class DictAuthChecker: +class DictAuthChecker(object): """Verifies usernames and passwords by looking them up in a dict.""" def __init__(self, users): """ @@ -387,7 +387,7 @@ class BasicAuthMiddleware(AuthenticationMiddleware): self, environ, start_response, exception) __all__.append("TracebackMiddleware") -class TracebackMiddleware: +class TracebackMiddleware(object): """In case the application throws an exception this middleware will show an html-formatted traceback using C{cgitb}.""" def __init__(self, app): -- cgit v1.2.3