# HG changeset patch # User Jeff Hammel # Date 1321559005 28800 # Node ID e07b0f675c1724eb62040dac53c172dea0a4c6e7 # Parent bb66c9a62be9bae863e983e71da5a3d8d1872d89 whitespace diff -r bb66c9a62be9 -r e07b0f675c17 wsgintegrate/dispatcher.py --- 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) + diff -r bb66c9a62be9 -r e07b0f675c17 wsgintegrate/match.py --- 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