# HG changeset patch # User k0s # Date 1256843465 14400 # Node ID 4ebaf68f22725ea33413aea96d7d72a40c8bc3e5 # Parent eb2cb7ebc8490493143abef4bc490793285fff8e moving to dispatcher as that's what it is now diff -r eb2cb7ebc849 -r 4ebaf68f2272 webob_view/template/+package+/+package+.py_tmpl --- a/webob_view/template/+package+/+package+.py_tmpl Thu Oct 29 15:08:54 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -""" -${repr(project)}: a view with webob -""" - -from handlers import Get, Post -from webob import Request, exc - -class Dispatcher(object): - - ### class level variables - defaults = {} - - def __init__(self, **kw): - for key in self.defaults: - setattr(self, key, kw.get(key, self.defaults[key])) - self.handlers = [ Get, Post ] - - ### methods dealing with HTTP - def __call__(self, environ, start_response): - request = Request(environ) - for h in self.handlers: - if h.match(request): - handler = h(request) - break - res = handler() - return res(environ, start_response) diff -r eb2cb7ebc849 -r 4ebaf68f2272 webob_view/template/+package+/dispatcher.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/webob_view/template/+package+/dispatcher.py Thu Oct 29 15:11:05 2009 -0400 @@ -0,0 +1,26 @@ +""" +request dispatcher +""" + +from handlers import Get, Post +from webob import Request, exc + +class Dispatcher(object): + + ### class level variables + defaults = {} + + def __init__(self, **kw): + for key in self.defaults: + setattr(self, key, kw.get(key, self.defaults[key])) + self.handlers = [ Get, Post ] + + ### methods dealing with HTTP + def __call__(self, environ, start_response): + request = Request(environ) + for h in self.handlers: + if h.match(request): + handler = h(request) + break + res = handler() + return res(environ, start_response)