def register_router(router_class):
    "Register a function to inspect a particular router.\n\n    This decorator registers a new function for a custom router\n    class, so that it can be inspected with the function\n    :func:`.inspect_routes`.\n    An inspection function takes the router instance used by the\n    application and returns a list of :class:`.RouteInfo`. Eg::\n\n        @register_router(MyRouterClass)\n        def inspect_my_router(router):\n            return [RouteInfo('foo', 'bar', '/path/to/foo.py:42', [])]\n\n    Args:\n        router_class (Type): The router class to register. If\n            already registered an error will be raised.\n    "

    def wraps(fn):
        if (router_class in _supported_routers):
            raise ValueError('Another function is already registered for the router {}'.format(router_class))
        _supported_routers[router_class] = fn
        return fn
    return wraps
Register a function to inspect a particular router.

This decorator registers a new function for a custom router
class, so that it can be inspected with the function
:func:`.inspect_routes`.
An inspection function takes the router instance used by the
application and returns a list of :class:`.RouteInfo`. Eg::

    @register_router(MyRouterClass)
    def inspect_my_router(router):
        return [RouteInfo('foo', 'bar', '/path/to/foo.py:42', [])]

Args:
    router_class (Type): The router class to register. If
        already registered an error will be raised.
def register_router(router_class):
    "Register a function to inspect a particular router.\n\n    This decorator registers a new function for a custom router\n    class, so that it can be inspected with the function\n    :func:`.inspect_routes`.\n    An inspection function takes the router instance used by the\n    application and returns a list of :class:`.RouteInfo`. Eg::\n\n        @register_router(MyRouterClass)\n        def inspect_my_router(router):\n            return [RouteInfo('foo', 'bar', '/path/to/foo.py:42', [])]\n\n    Args:\n        router_class (Type): The router class to register. If\n            already registered an error will be raised.\n    "

    def wraps(fn):
        if (router_class in _supported_routers):
            raise ValueError('Another function is already registered for the router {}'.format(router_class))
        _supported_routers[router_class] = fn
        return fn
    return wraps