diff -r 9c7769850195 -r 6db2527b67cf qmsk/irclogs/wsgi.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qmsk/irclogs/wsgi.py Sun Sep 13 01:15:56 2009 +0300 @@ -0,0 +1,31 @@ +""" + Our custom WSGI application +""" + +from qmsk.web import wsgi + +import urls, error + +# our custom app with custom error() method +class Application (wsgi.Application) : + def __init__ (self) : + """ + Construct wsgi.Application with our URLMapper + """ + + super(Application, self).__init__(urls.mapper) + + def handle_error (self, exc_info, env, start_response) : + """ + Use error.build_error and return that + """ + + # get info + status, content_type, body = error.build_error(env=env) + + # headers + start_response(status, [('Content-type', content_type)], exc_info) + + # body + return body +