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>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2021-12-04 16:39:40 -05:00
1 parent 3421469825
commit 603b63bbac
7 files changed
+198 -109

No files matched your search

+2 -2
View File
@@ -18,7 +18,7 @@ from plinth.modules.apache.components import diagnose_url
from plinth.modules.backups.components import BackupRestore
from plinth.modules.names.components import DomainType
from plinth.package import Packages
from plinth.signals import domain_added, domain_removed, post_module_loading
from plinth.signals import domain_added, domain_removed, post_app_loading
from plinth.utils import format_lazy
from . import components, manifest
@@ -85,7 +85,7 @@ class LetsEncryptApp(app_module.App):
domain_added.connect(on_domain_added)
domain_removed.connect(on_domain_removed)
post_module_loading.connect(_certificate_handle_modified)
post_app_loading.connect(_certificate_handle_modified)
def diagnose(self):
"""Run diagnostics and return the results."""