add some messages to ui

This commit is contained in:
Mathieu Broillet 2024-08-29 13:13:49 +02:00
parent 303f73433f
commit 76c9ce8fe5
Signed by: mathieu
GPG Key ID: A08E484FE95074C1
2 changed files with 6 additions and 5 deletions

View File

@ -81,7 +81,6 @@ class Stack:
self.start() self.start()
else: else:
logger.warning(f"Could not update {self.name} as {self.name} is not installed") logger.warning(f"Could not update {self.name} as {self.name} is not installed")
choices.any_key.ask()
def _update(self): def _update(self):
pass pass
@ -100,7 +99,6 @@ class Stack:
self._start() self._start()
else: else:
logger.error(f"{self.name} is not installed") logger.error(f"{self.name} is not installed")
choices.any_key.ask()
def _start(self): def _start(self):
pass pass

View File

@ -2,7 +2,7 @@ import os
import questionary import questionary
from core.vars import logger, loaded_services from core.vars import loaded_services
from ui import choices from ui import choices
from ui.choices import update_choices from ui.choices import update_choices
@ -19,12 +19,15 @@ def handle_services(action, service):
service = loaded_services[service] service = loaded_services[service]
if action == "start": if action == "start":
questionary.print(f"Starting {service.name}...")
service.start() service.start()
elif action == "stop": elif action == "stop":
questionary.print(f"Stopping {service.name}...")
service.stop() service.stop()
elif action == "install": elif action == "install":
confirmation = choices.are_you_sure.ask() confirmation = choices.are_you_sure.ask()
if confirmation: if confirmation:
questionary.print(f"Installing {service.name}...")
service.install() service.install()
elif action == "uninstall": elif action == "uninstall":
confirmation = choices.are_you_sure.ask() confirmation = choices.are_you_sure.ask()
@ -34,9 +37,9 @@ def handle_services(action, service):
value = type_confirmation.ask() value = type_confirmation.ask()
if value == "cancel": if value == "cancel":
questionary.print("Canceled", style="fg:ansired") questionary.print("Canceled", style="fg:ansired bold")
elif value != service.id: elif value != service.id:
questionary.print("Invalid input, please try again", style="fg:ansired") questionary.print("Invalid input, please try again", style="fg:ansired bold")
elif value == service.id: elif value == service.id:
service.uninstall() service.uninstall()