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

Method __getitem__

invoke/collection.py:358–372  ·  view source on GitHub ↗

Returns task named ``name``. Honors aliases and subcollections. If this collection has a default task, it is returned when ``name`` is empty or ``None``. If empty input is given and no task has been selected as the default, ValueError will be raised. Tasks

(self, name: Optional[str] = None)

Source from the content-addressed store, hash-verified

356 return collection
357
358 def __getitem__(self, name: Optional[str] = None) -> Any:
359 """
360 Returns task named ``name``. Honors aliases and subcollections.
361
362 If this collection has a default task, it is returned when ``name`` is
363 empty or ``None``. If empty input is given and no task has been
364 selected as the default, ValueError will be raised.
365
366 Tasks within subcollections should be given in dotted form, e.g.
367 'foo.bar'. Subcollection default tasks will be returned on the
368 subcollection's name.
369
370 .. versionadded:: 1.0
371 """
372 return self.task_with_config(name)[0]
373
374 def _task_with_merged_config(
375 self, coll: str, rest: str, ours: Dict[str, Any]

Callers

nothing calls this directly

Calls 1

task_with_configMethod · 0.95

Tested by

no test coverage detected