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)
| 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 | """ |
no outgoing calls
no test coverage detected