From b0cfd74b6c355a20fb49cb90774e888f04fefdb4 Mon Sep 17 00:00:00 2001 From: flxdot Date: Thu, 18 Apr 2024 23:57:22 +0200 Subject: [PATCH] traceback --- services/device/device/cli/config.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/services/device/device/cli/config.py b/services/device/device/cli/config.py index 9aca5e6f..d3a91870 100644 --- a/services/device/device/cli/config.py +++ b/services/device/device/cli/config.py @@ -1,5 +1,6 @@ from __future__ import print_function, unicode_literals +import traceback from typing import TypeVar import typer @@ -67,22 +68,22 @@ def test(): # pragma: no cover exceptions = {} results = {} for io in IoManager().setup().ios: - console.print(f"[cyan]Testing {io} ... ", end="") + console.print(f"[cyan]Testing {io} ... [/cyan]", end="") try: result = io.test() - console.print("[green]passed") + console.print("[green]passed[/green]") if result: results[io.identifier] = result except Exception as e: - console.print("[red]failed") + console.print("[red]failed[/red]") exceptions[io.identifier] = e if results: - console.print("\n[cyan]The following IO peripherals returned data:") + console.print("\nThe following IO peripherals returned data:") for identifier, result in results.items(): - console.print(f"[cyan]{identifier}: {result}") + console.print(f"{identifier}: {result}") if exceptions: - console.print("\n[red]The following IO peripherals failed:") + console.print("\nThe following IO peripherals [red]failed[/red]:") for identifier, exception in exceptions.items(): - console.print(f"[red]{identifier}: {exception}") + console.print(f"[red]{identifier}: {traceback.format_exception(exception)}")