-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1277 from buildtesters/issue_1206
Add option buildtest --helpcolor to show available color options in table format
- Loading branch information
Showing
6 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from buildtest.defaults import console | ||
from rich.color import ANSI_COLOR_NAMES | ||
from rich.table import Table | ||
|
||
|
||
def print_available_colors(): | ||
"""Print the available color options in a table format on background of the color option.""" | ||
table = Table( | ||
"Number", | ||
"Color", | ||
header_style="blue", | ||
title="Available Colors", | ||
) | ||
for color, number in ANSI_COLOR_NAMES.items(): | ||
table.add_row(f"[black]{number}", f"[black]{color}", style="on " + color) | ||
console.print(table) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from buildtest.cli.helpcolor import print_available_colors | ||
|
||
|
||
def test_buildtest_helpcolor(): | ||
print_available_colors() |