FreedomBox/plinth/signals.py
Sunil Mohan Adapa 603b63bbac
module_loader, app: Move app init to app module
- Don't try to get the depends from module level and sort modules based on that.

- Instead after all App instances are created, sort the apps based on
app.info.depends and app.info.is_essential.

- Print message that apps have been initialized instead of printing before they
are initialized. The correct order of apps is only known after they have been
initialized and sorted.

- Avoid circular import on module_loader and setup.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-04 16:39:40 -05:00

28 lines
551 B
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Django signals emitted within FreedomBox.
"""
from django.dispatch import Signal
# Arguments: -
pre_module_loading = Signal()
# Arguments: -
post_app_loading = Signal()
# Arguments: module_name
post_setup = Signal()
# Arguments: old_hostname, new_hostname
pre_hostname_change = Signal()
# Arguments: old_hostname, new_hostname
post_hostname_change = Signal()
# Arguments: domain_type, name, description, services
domain_added = Signal()
# Arguments: domain_type, name
domain_removed = Signal()