Finalize the app. This loads built-in tasks, evaluates pending task decorators, reads configuration, etc.
(self, auto=False)
| 651 | return gen_task_name(self, name, module) |
| 652 | |
| 653 | def finalize(self, auto=False): |
| 654 | """Finalize the app. |
| 655 | |
| 656 | This loads built-in tasks, evaluates pending task decorators, |
| 657 | reads configuration, etc. |
| 658 | """ |
| 659 | with self._finalize_mutex: |
| 660 | if not self.finalized: |
| 661 | if auto and not self.autofinalize: |
| 662 | raise RuntimeError('Contract breach: app not finalized') |
| 663 | self.finalized = True |
| 664 | _announce_app_finalized(self) |
| 665 | |
| 666 | pending = self._pending |
| 667 | while pending: |
| 668 | maybe_evaluate(pending.popleft()) |
| 669 | |
| 670 | for task in self._tasks.values(): |
| 671 | task.bind(self) |
| 672 | |
| 673 | self.on_after_finalize.send(sender=self) |
| 674 | |
| 675 | def add_defaults(self, fun): |
| 676 | """Add default configuration from dict ``d``. |
no test coverage detected