mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-12 07:40:41 -08:00
90 lines
1.6 KiB
Python
90 lines
1.6 KiB
Python
import sys
|
|
from rich.console import Console
|
|
from rich.table import Table
|
|
from rich.rule import Rule
|
|
from rich.markdown import Markdown
|
|
|
|
console = Console(force_terminal=True, color_system="truecolor")
|
|
|
|
HEADER_COLOR = sys.argv[1]
|
|
SEPARATOR_COLOR = sys.argv[2]
|
|
|
|
|
|
def rule(title: str | None = None):
|
|
console.print(Rule(style=f"rgb({SEPARATOR_COLOR})"))
|
|
|
|
|
|
console.print("{TITLE}", justify="center")
|
|
|
|
left = [
|
|
(
|
|
"Score",
|
|
"Favorites",
|
|
"Popularity",
|
|
"Status",
|
|
),
|
|
(
|
|
"Episodes",
|
|
"Duration",
|
|
"Next Episode",
|
|
),
|
|
(
|
|
"Genres",
|
|
"Format",
|
|
),
|
|
(
|
|
"List Status",
|
|
"Progress",
|
|
),
|
|
(
|
|
"Start Date",
|
|
"End Date",
|
|
),
|
|
("Studios",),
|
|
("Synonymns",),
|
|
("Tags",),
|
|
]
|
|
right = [
|
|
(
|
|
"{SCORE}",
|
|
"{FAVOURITES}",
|
|
"{POPULARITY}",
|
|
"{STATUS}",
|
|
),
|
|
(
|
|
"{EPISODES}",
|
|
"{DURATION}",
|
|
"{NEXT_EPISODE}",
|
|
),
|
|
(
|
|
"{GENRES}",
|
|
"{FORMAT}",
|
|
),
|
|
(
|
|
"{USER_STATUS}",
|
|
"{USER_PROGRESS}",
|
|
),
|
|
(
|
|
"{START_DATE}",
|
|
"{END_DATE}",
|
|
),
|
|
("{STUDIOS}",),
|
|
("{SYNONYMNS}",),
|
|
("{TAGS}",),
|
|
]
|
|
|
|
|
|
for L_grp, R_grp in zip(left, right):
|
|
table = Table.grid(expand=True)
|
|
table.add_column(justify="left", no_wrap=True)
|
|
table.add_column(justify="right", overflow="fold")
|
|
for L, R in zip(L_grp, R_grp):
|
|
table.add_row(f"[bold rgb({HEADER_COLOR})]{L} [/]", f"{R}")
|
|
|
|
rule()
|
|
console.print(table)
|
|
|
|
|
|
rule()
|
|
console.print(Markdown("""{SYNOPSIS}"""))
|