rasa/core/utils.py
def list_routes(app: Sanic):
    """List all the routes of a sanic application.

    Mainly used for debugging."""
    from urllib.parse import unquote
    output = {}

    def find_route(suffix, path):
        for name, (uri, _) in app.router.routes_names.items():
            if name.endswith(suffix) and uri == path:
                return name
        return None

    for endpoint, route in app.router.routes_all.items():
        if endpoint[:-1] in app.router.routes_all and endpoint[-1] == "/":
            continue

        options = {}
        for arg in route.parameters:
            options[arg] = "[{0}]".format(arg)

        if not isinstance(route.handler, CompositionView):
            handlers = [(list(route.methods)[0], route.name)]
        else:
            handlers = [(method, find_route(v.__name__, endpoint) or v.__name__)
                        for method, v in route.handler.handlers.items()]

        for method, name in handlers:
            line = unquote(
                "{:50s} {:30s} {}".format(endpoint, method, name))
            output[name] = line

    url_table = "\n".join(output[url] for url in sorted(output))
    logger.debug("Available web server routes: \n{}".format(url_table))

    return output
List all the routes of a sanic application.

    Mainly used for debugging.
List all the routes of a sanic application.
Mainly used for debugging.
List all the routes of a sanic application . Mainly used for debugging .
def list_routes(app: Sanic):
    from urllib.parse import unquote
    output = {}
    def find_route(suffix, path):
        for name, (uri, _) in app.router.routes_names.items():
            if name.endswith(suffix) and uri == path:
                return name
        return None
    for endpoint, route in app.router.routes_all.items():
        if endpoint[:-1] in app.router.routes_all and endpoint[-1] == "/":
            continue
        options = {}
        for arg in route.parameters:
            options[arg] = "[{0}]".format(arg)
        if not isinstance(route.handler, CompositionView):
            handlers = [(list(route.methods)[0], route.name)]
        else:
            handlers = [(method, find_route(v.__name__, endpoint) or v.__name__)
                        for method, v in route.handler.handlers.items()]
        for method, name in handlers:
            line = unquote(
                "{:50s} {:30s} {}".format(endpoint, method, name))
            output[name] = line
    url_table = "\n".join(output[url] for url in sorted(output))
    logger.debug("Available web server routes: \n{}".format(url_table))
    return output
def list_routes ( app : Sanic ) : from urllib . parse import unquote output = { } def find_route ( suffix , path ) : for name , ( uri , _ ) in app . router . routes_names . items ( ) : if name . endswith ( suffix ) and uri == path : return name return None for endpoint , route in app . router . routes_all . items ( ) : if endpoint [ : - 1 ] in app . router . routes_all and endpoint [ - 1 ] == "/" : continue options = { } for arg in route . parameters : options [ arg ] = "[{0}]" . format ( arg ) if not isinstance ( route . handler , CompositionView ) : handlers = [ ( list ( route . methods ) [ 0 ] , route . name ) ] else : handlers = [ ( method , find_route ( v . __name__ , endpoint ) or v . __name__ ) for method , v in route . handler . handlers . items ( ) ] for method , name in handlers : line = unquote ( "{:50s} {:30s} {}" . format ( endpoint , method , name ) ) output [ name ] = line url_table = "\n" . join ( output [ url ] for url in sorted ( output ) ) logger . debug ( "Available web server routes: \n{}" . format ( url_table ) ) return output
List all the routes of a sanic application.
List all the routes of a sanic application .
"""List all the routes of a sanic application.

    Mainly used for debugging."""
app
Sanic