From 9c7e8ed2f33d50bcf692f584608b0d7fd875e868 Mon Sep 17 00:00:00 2001 From: Henry LE BERRE Date: Thu, 6 Jun 2024 10:36:46 +0200 Subject: [PATCH] Review: Small tweaks & fixes --- toolchain/main.py | 8 ++++---- toolchain/mfc/common.py | 2 -- toolchain/mfc/lock.py | 2 +- toolchain/mfc/state.py | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/toolchain/main.py b/toolchain/main.py index af10904ac4..e9c6e443ec 100644 --- a/toolchain/main.py +++ b/toolchain/main.py @@ -21,11 +21,11 @@ def __print_greeting(): MFC_SIDEBAR_LINES = [ f"[bold]{host_line}[/bold]", '-' * len(host_line), - f"[bold]--jobs [magenta]{ARG('jobs')}[/magenta][/bold]" - ] + [ - f"[bold]--{'' if getattr(state.gCFG, field.name) else 'no-'}{field.name}[/bold]" for field in dataclasses.fields(state.gCFG) - ] + [ + '', + f"[bold]--jobs [magenta]{ARG('jobs')}[/magenta][/bold]", + f"[bold]{' '.join(state.gCFG.make_options())}[/bold]", targets_line if ARG("command") != "test" else "", + '', '-' * len(help_line), f"[yellow]{help_line}[/yellow]", ] diff --git a/toolchain/mfc/common.py b/toolchain/mfc/common.py index 5bf2af361b..d91b68cc04 100644 --- a/toolchain/mfc/common.py +++ b/toolchain/mfc/common.py @@ -22,8 +22,6 @@ .:-=++++===--==+=-+= +. := +#=::::::::=%=. -+: =+ *: .*=-=*=.. :=+*+: -...-- - -\ """ diff --git a/toolchain/mfc/lock.py b/toolchain/mfc/lock.py index 1513a8a43f..14139f9fff 100644 --- a/toolchain/mfc/lock.py +++ b/toolchain/mfc/lock.py @@ -5,7 +5,7 @@ from .printer import cons -MFC_LOCK_CURRENT_VERSION: int = 3 +MFC_LOCK_CURRENT_VERSION: int = 4 @dataclasses.dataclass diff --git a/toolchain/mfc/state.py b/toolchain/mfc/state.py index bf606f37cb..1b69f0ed33 100644 --- a/toolchain/mfc/state.py +++ b/toolchain/mfc/state.py @@ -29,7 +29,7 @@ def make_options(self) -> typing.List[str]: def make_slug(self) -> str: """ Sort the items by key, then join them with underscores. This uniquely - identifies the configuration. Example: no-debug no-gpu no_mpi """ + identifies the configuration. Example: no-debug_no-gpu_no_mpi_no-gcov """ return '_'.join([ f"{'no-' if not v else ''}{k}" for k, v in sorted(self.items(), key=lambda x: x[0]) ]) def __eq__(self, other) -> bool: @@ -41,7 +41,7 @@ def __eq__(self, other) -> bool: return True def __str__(self) -> str: - """ Returns a string like "mpi=No & gpu=No & debug=No" & gcov=No """ + """ Returns a string like "mpi=No & gpu=No & debug=No & gcov=No" """ return ' & '.join([ f"{k}={'Yes' if v else 'No'}" for k, v in self.items() ])