Return all task identifiers for this collection as a one-level dict. Specifically, a dict with the primary/"real" task names as the key, and any aliases as a list value. It basically collapses the namespace tree into a single easily-scannable collection of
(self)
| 511 | |
| 512 | @property |
| 513 | def task_names(self) -> Dict[str, List[str]]: |
| 514 | """ |
| 515 | Return all task identifiers for this collection as a one-level dict. |
| 516 | |
| 517 | Specifically, a dict with the primary/"real" task names as the key, and |
| 518 | any aliases as a list value. |
| 519 | |
| 520 | It basically collapses the namespace tree into a single |
| 521 | easily-scannable collection of invocation strings, and is thus suitable |
| 522 | for things like flat-style task listings or transformation into parser |
| 523 | contexts. |
| 524 | |
| 525 | .. versionadded:: 1.0 |
| 526 | """ |
| 527 | ret = {} |
| 528 | # Our own tasks get no prefix, just go in as-is: {name: [aliases]} |
| 529 | for name, task in self.tasks.items(): |
| 530 | ret[name] = list(map(self.transform, task.aliases)) |
| 531 | # Subcollection tasks get both name + aliases prefixed |
| 532 | for coll_name, coll in self.collections.items(): |
| 533 | for task_name, aliases in coll.task_names.items(): |
| 534 | aliases = list( |
| 535 | map(lambda x: self.subtask_name(coll_name, x), aliases) |
| 536 | ) |
| 537 | # Tack on collection name to alias list if this task is the |
| 538 | # collection's default. |
| 539 | if coll.default == task_name: |
| 540 | aliases += (coll_name,) |
| 541 | ret[self.subtask_name(coll_name, task_name)] = aliases |
| 542 | return ret |
| 543 | |
| 544 | def configuration(self, taskpath: Optional[str] = None) -> Dict[str, Any]: |
| 545 | """ |
nothing calls this directly
no test coverage detected