From b2be821637b18a6ab65ff67a1ce18ccf11d9367d Mon Sep 17 00:00:00 2001 From: Suby Raman Date: Mon, 13 Feb 2017 11:55:00 -0500 Subject: [PATCH] reverse router changes --- sanic/router.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sanic/router.py b/sanic/router.py index c115b362..24d0438f 100644 --- a/sanic/router.py +++ b/sanic/router.py @@ -4,7 +4,8 @@ from functools import lru_cache from .exceptions import NotFound, InvalidUsage from .views import CompositionView -Route = namedtuple('Route', +Route = namedtuple( + 'Route', ['handler', 'methods', 'pattern', 'parameters', 'name']) Parameter = namedtuple('Parameter', ['name', 'cast']) @@ -145,7 +146,7 @@ class Router: return '({})'.format(pattern) - pattern_string = re.sub(r'<(.+?)>', add_parameter, uri) + pattern_string = re.sub(self.parameter_pattern, add_parameter, uri) pattern = re.compile(r'^{}$'.format(pattern_string)) def merge_route(route, methods, handler):