MCPcopy
hub / github.com/ormar-orm/ormar / join_path

Function join_path

ormar/models/excludable.py:839–854  ·  view source on GitHub ↗

Build a user-facing dunder path string from a pre-split tuple, optionally appending one extra segment. Used only for error messages — the rest of the module keeps paths as tuples. :param parts: pre-split path segments :type parts: PathParts :param tail: optional additional

(parts: PathParts, tail: Optional[str] = None)

Source from the content-addressed store, hash-verified

837
838
839def join_path(parts: PathParts, tail: Optional[str] = None) -> str:
840 """
841 Build a user-facing dunder path string from a pre-split tuple, optionally
842 appending one extra segment. Used only for error messages — the rest of
843 the module keeps paths as tuples.
844
845 :param parts: pre-split path segments
846 :type parts: PathParts
847 :param tail: optional additional segment to append
848 :type tail: Optional[str]
849 :return: dunder-joined path string
850 :rtype: str
851 """
852 if tail is None:
853 return "__".join(parts)
854 return "__".join(parts + (tail,)) if parts else tail

Calls

no outgoing calls

Tested by

no test coverage detected