# HG changeset patch # User k0s # Date 1258576751 18000 # Node ID d54f85043f77f1f824b5ee4f63e0653de545b115 # Parent 6075ca965357bea3e193f61a8f71c27ceed56deb better and more configurable matching logic diff -r 6075ca965357 -r d54f85043f77 genshi_view/template/+package+/handlers.py --- a/genshi_view/template/+package+/handlers.py Sat Nov 07 22:55:06 2009 -0500 +++ b/genshi_view/template/+package+/handlers.py Wed Nov 18 15:39:11 2009 -0500 @@ -16,21 +16,21 @@ @classmethod def match(cls, app, request): + + # check the method + if request.method not in cls.methods: + return None + + # check the path + if request.environ['path'][:len(cls.handler_path)] != cls.handler_path: + return None + try: return cls(app, request) except HandlerMatchException: return None def __init__(self, app, request): - - # check the method - if request.method not in self.methods: - raise HandlerMatchException - - # check the path - if request.environ['path'][:len(self.handler_path)] != self.handler_path: - raise HandlerMatchException - self.app = app self.request = request self.application_path = urlparse(request.application_url)[2]