Fix our url converters to not be silly

This commit is contained in:
Jake Moshenko 2016-05-04 17:38:21 -04:00
parent 73e323c4d6
commit 1ef7008d85

9
app.py
View file

@ -128,15 +128,16 @@ app.request_class = RequestWithId
# Register custom converters.
class RegexConverter(BaseConverter):
""" Converter for handling custom regular expression patterns in paths. """
def __init__(self, url_map, *items):
def __init__(self, url_map, regex_value):
super(RegexConverter, self).__init__(url_map)
self.regex = items[0]
self.regex = regex_value
class RepositoryPathConverter(BaseConverter):
""" Converter for handling repository paths. Handles both library and non-library paths (if
configured).
"""
def __init__(self, url_map, *items):
def __init__(self, url_map):
super(RepositoryPathConverter, self).__init__(url_map)
self.weight = 200
@ -150,7 +151,7 @@ class RepositoryPathConverter(BaseConverter):
class APIRepositoryPathConverter(BaseConverter):
""" Converter for handling repository paths. Does not handle library paths.
"""
def __init__(self, url_map, *items):
def __init__(self, url_map):
super(APIRepositoryPathConverter, self).__init__(url_map)
self.weight = 200
self.regex = r'([^/]+/[^/]+)'