From 5a1febb37bcb34cf2d95d0ee888254be5f8dae77 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 10 2015 14:30:37 +0000 Subject: Drop the '%s' in the routes by just prefixing the prefix --- diff --git a/mdapi/__init__.py b/mdapi/__init__.py index 57269bb..199e64f 100644 --- a/mdapi/__init__.py +++ b/mdapi/__init__.py @@ -186,14 +186,14 @@ def init(loop): routes.append(('%s', index)) routes.extend([ - ('%s/', index), - ('%s/branches', list_branches), - ('%s/{branch}/pkg/{name}', get_pkg), - ('%s/{branch}/files/{name}', get_pkg_files), - ('%s/{branch}/changelog/{name}', get_pkg_changelog), + ('/', index), + ('/branches', list_branches), + ('/{branch}/pkg/{name}', get_pkg), + ('/{branch}/files/{name}', get_pkg_files), + ('/{branch}/changelog/{name}', get_pkg_changelog), ]) for route in routes: - app.router.add_route('GET', route[0] % prefix, route[1]) + app.router.add_route('GET', prefix + route[0], route[1]) srv = yield from loop.create_server( app.make_handler(),