--- a/lib/handler.py Sat Feb 07 06:05:10 2009 +0200
+++ b/lib/handler.py Sat Feb 07 06:54:52 2009 +0200
@@ -2,6 +2,24 @@
The actual application behaviour, i.e. generating a Response from a Request :)
"""
+class Handler (object) :
+ """
+ A handler handles a Request, returning a Response
+ """
+
+ def __init__ (self, func, *args, **kwargs) :
+ self.func = func
+ self.args = args
+ self.kwargs = kwargs
+
+ def handle_request (self, request) :
+ """
+ Handle the request, returning a Response object
+ """
+
+ return self.func(request, *self.args, **self.kwargs)
+
+# fs handler
import http, page, menu, template
def handle_request (request) :