MCPcopy Index your code
hub / github.com/pyinvoke/invoke / _split_path

Method _split_path

invoke/collection.py:331–344  ·  view source on GitHub ↗

Obtain first collection + remainder, of a task path. E.g. for ``"subcollection.taskname"``, return ``("subcollection", "taskname")``; for ``"subcollection.nested.taskname"`` return ``("subcollection", "nested.taskname")``, etc. An empty path becomes simply

(self, path: str)

Source from the content-addressed store, hash-verified

329 raise ValueError(msg.format(name, self.default))
330
331 def _split_path(self, path: str) -> Tuple[str, str]:
332 """
333 Obtain first collection + remainder, of a task path.
334
335 E.g. for ``"subcollection.taskname"``, return ``("subcollection",
336 "taskname")``; for ``"subcollection.nested.taskname"`` return
337 ``("subcollection", "nested.taskname")``, etc.
338
339 An empty path becomes simply ``('', '')``.
340 """
341 parts = path.split(".")
342 coll = parts.pop(0)
343 rest = ".".join(parts)
344 return coll, rest
345
346 def subcollection_from_path(self, path: str) -> "Collection":
347 """

Callers 1

task_with_configMethod · 0.95

Calls 2

joinMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected