MCPcopy Create free account
hub / github.com/dot-agent/nextpy / format_breadcrumbs

Function format_breadcrumbs

nextpy/utils/format.py:603–618  ·  view source on GitHub ↗

Take a route and return a list of tuple for use in breadcrumb. Args: route: The route to transform. Returns: list[tuple[str, str]]: the list of tuples for the breadcrumb.

(route: str)

Source from the content-addressed store, hash-verified

601
602
603def format_breadcrumbs(route: str) -> list[tuple[str, str]]:
604 """Take a route and return a list of tuple for use in breadcrumb.
605
606 Args:
607 route: The route to transform.
608
609 Returns:
610 list[tuple[str, str]]: the list of tuples for the breadcrumb.
611 """
612 route_parts = route.lstrip("/").split("/")
613
614 # create and return breadcrumbs
615 return [
616 (part, "/".join(["", *route_parts[: i + 1]]))
617 for i, part in enumerate(route_parts)
618 ]
619
620
621def format_library_name(library_fullname: str):

Callers

nothing calls this directly

Calls 2

splitMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected