# Path: boiler/routes/regex.py
# class RegexConverter(BaseConverter):
#     """
#     Regex converter
#     Allows to use regular expressions in flask urls definitions.
#     An example of route definition: '/<regex("[abcABC0-9]{4,6}"):user>-<slug>/
#     Will produce: user and slug variables.
#     """
#     def __init__(self, url_map, *items):
#         super(RegexConverter, self).__init__(url_map)
#         self.regex = items[0]


from werkzeug.utils import import_string
from boiler.routes.regex import RegexConverter


def routing_feature(app):
    """
    Add routing feature
    Allows to define application routes un urls.py file and use lazy views.
    Additionally enables regular exceptions in route definitions
    """
    # enable regex routes

# Path: boiler/routes/regex.py
# class RegexConverter(BaseConverter):
#     """
#     Regex converter
#     Allows to use regular expressions in flask urls definitions.
#     An example of route definition: '/<regex("[abcABC0-9]{4,6}"):user>-<slug>/
#     Will produce: user and slug variables.
#     """
#     def __init__(self, url_map, *items):
#         super(RegexConverter, self).__init__(url_map)
#         self.regex = items[0]


# Path: boiler/feature/routing.py
from werkzeug.utils import import_string
from boiler.routes.regex import RegexConverter



def routing_feature(app):
    """
    Add routing feature
    Allows to define application routes un urls.py file and use lazy views.
    Additionally enables regular exceptions in route definitions
    """
    # enable regex routes

    app.url_map.converters['regex'] = RegexConverter