pvl.web.Handler: STATUS/status()
authorTero Marttila <terom@paivola.fi>
Mon, 13 Jan 2014 21:14:30 +0200
changeset 368 be42e2d38c77
parent 367 e431a1b71006
child 369 e6d0e8a967ac
pvl.web.Handler: STATUS/status()
pvl/web/application.py
--- a/pvl/web/application.py	Mon Jan 13 20:25:36 2014 +0200
+++ b/pvl/web/application.py	Mon Jan 13 21:14:30 2014 +0200
@@ -89,6 +89,8 @@
         #"/static/....js"
     )
 
+    STATUS = 200
+
     def __init__ (self, app, request, urls, params) :
         """
             app     - wsgi.Application
@@ -120,6 +122,13 @@
 
         return self.urls.build(handler, params)
 
+    def status (self) :
+        """
+            Return HTTP status code for response.
+        """
+
+        return self.STATUS
+
     def title (self) :
         """
             Render site/page title as text.
@@ -204,7 +213,9 @@
         # XXX: might also be string?
         text = unicode(self.render_html())
 
-        return pvl.web.response.html(text)
+        return pvl.web.response.html(text,
+                status  = self.status(),
+        )
     
     def cleanup (self) :
         """