Mercurial > hg > wsgintegrate
changeset 14:e07b0f675c17
whitespace
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 17 Nov 2011 11:43:25 -0800 |
parents | bb66c9a62be9 |
children | 1a7bbd97dda4 |
files | wsgintegrate/dispatcher.py wsgintegrate/match.py |
diffstat | 2 files changed, 22 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/wsgintegrate/dispatcher.py Thu Nov 17 11:36:19 2011 -0800 +++ b/wsgintegrate/dispatcher.py Thu Nov 17 11:43:25 2011 -0800 @@ -7,23 +7,24 @@ class Dispatcher(object): - def __init__(self, *apps): - self.apps = apps - self.codes = set([404]) + def __init__(self, *apps): + self.apps = apps + self.codes = set([404]) - def __call__(self, environ, start_response): - request = Request(environ) - for app in self.apps: - try: - response = request.get_response(app) - if response.status_int in self.codes: - continue - break - except exc.HTTPNotFound: - continue - except: - print app - raise - else: - response = exc.HTTPNotFound() - return response(environ, start_response) + def __call__(self, environ, start_response): + request = Request(environ) + for app in self.apps: + try: + response = request.get_response(app) + if response.status_int in self.codes: + continue + break + except exc.HTTPNotFound: + continue + except: + print app + raise + else: + response = exc.HTTPNotFound() + return response(environ, start_response) +
--- a/wsgintegrate/match.py Thu Nov 17 11:36:19 2011 -0800 +++ b/wsgintegrate/match.py Thu Nov 17 11:43:25 2011 -0800 @@ -124,7 +124,7 @@ self.kw = kw def condition(self, environ): raise NotImplementedError # TODO - + ### logical checkers (currently unused) class AND(RequestMatch): @@ -154,7 +154,7 @@ return True else: if condition(): - return + return return False # string accessible list of conditions