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

Method execute

invoke/program.py:559–583  ·  view source on GitHub ↗

Hand off data & tasks-to-execute specification to an `.Executor`. .. note:: Client code just wanting a different `.Executor` subclass can just set ``executor_class`` in `.__init__`, or override ``tasks.executor_class`` anywhere in the :ref:`confi

(self)

Source from the content-addressed store, hash-verified

557 raise Exit
558
559 def execute(self) -> None:
560 """
561 Hand off data & tasks-to-execute specification to an `.Executor`.
562
563 .. note::
564 Client code just wanting a different `.Executor` subclass can just
565 set ``executor_class`` in `.__init__`, or override
566 ``tasks.executor_class`` anywhere in the :ref:`config system
567 <default-values>` (which may allow you to avoid using a custom
568 Program entirely).
569
570 .. versionadded:: 1.0
571 """
572 klass = self.executor_class
573 config_path = self.config.tasks.executor_class
574 if config_path is not None:
575 # TODO: why the heck is this not builtin to importlib?
576 module_path, _, class_name = config_path.rpartition(".")
577 # TODO: worth trying to wrap both of these and raising ImportError
578 # for cases where module exists but class name does not? More
579 # "normal" but also its own possible source of bugs/confusion...
580 module = import_module(module_path)
581 klass = getattr(module, class_name)
582 executor = klass(self.collection, self.config, self.core)
583 executor.execute(*self.tasks)
584
585 def normalize_argv(self, argv: Optional[List[str]]) -> None:
586 """

Callers 15

runMethod · 0.95
base_caseMethod · 0.45
kwargsMethod · 0.45
pre_tasksMethod · 0.45
post_tasksMethod · 0.45
base_caseMethod · 0.45
with_pre_tasksMethod · 0.45
with_post_tasksMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected