Skip to content

Commit

Permalink
Review: Small tweaks & fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
henryleberre committed Jun 6, 2024
1 parent aa66f1b commit 9c7e8ed
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions toolchain/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
]
Expand Down
2 changes: 0 additions & 2 deletions toolchain/mfc/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
.:-=++++===--==+=-+= +. :=
+#=::::::::=%=. -+: =+ *:
.*=-=*=.. :=+*+: -...--
\
"""


Expand Down
2 changes: 1 addition & 1 deletion toolchain/mfc/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .printer import cons


MFC_LOCK_CURRENT_VERSION: int = 3
MFC_LOCK_CURRENT_VERSION: int = 4


@dataclasses.dataclass
Expand Down
4 changes: 2 additions & 2 deletions toolchain/mfc/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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() ])

Expand Down

0 comments on commit 9c7e8ed

Please sign in to comment.