From a54e976e21d2d7746963af7090bd917b7f3b206e Mon Sep 17 00:00:00 2001 From: axolotle Date: Wed, 23 Nov 2022 16:08:22 +0100 Subject: [PATCH] app_install: update notifications display with helpers --- src/app.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/app.py b/src/app.py index c938a91c4..b8e1cc771 100644 --- a/src/app.py +++ b/src/app.py @@ -908,11 +908,10 @@ def app_install( # Display pre_install notices in cli mode if manifest["notifications"]["pre_install"] and Moulinette.interface.type == "cli": - for notice in manifest["notifications"]["pre_install"].values(): - # Should we render the markdown maybe? idk - print("==========") - print(_value_for_locale(notice)) - print("==========") + notifications = _filter_and_hydrate_notifications( + manifest["notifications"]["pre_install"] + ) + _display_notifications(notifications, force=force) packaging_format = manifest["packaging_format"] @@ -1182,13 +1181,12 @@ def app_install( # Display post_install notices in cli mode if manifest["notifications"]["post_install"] and Moulinette.interface.type == "cli": - # (Call app_info to get the version hydrated with settings) - infos = app_info(app_instance_name, full=True) - for notice in infos["manifest"]["notifications"]["post_install"].values(): - # Should we render the markdown maybe? idk - print("==========") - print(_value_for_locale(notice)) - print("==========") + # Get the generated settings to hydrate notifications + settings = _get_app_settings(app_instance_name) + notifications = _filter_and_hydrate_notifications( + manifest["notifications"]["post_install"], data=settings + ) + _display_notifications(notifications, force=force) # Call postinstall hook hook_callback("post_app_install", env=env_dict)