diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-10-09 22:54:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-10-09 22:54:06 +0100 |
commit | 9641629f358be1c67bee22cf4c64da179aedae48 (patch) | |
tree | 08bdcef9b5bc18e56860f7073ffa48b97476dbea | |
parent | 000419569794cf93adac725cbf3dc521378c9a28 (diff) |
colorise article headlines, read -> green, unread -> red
-rw-r--r-- | src/backend/getnews.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/backend/getnews.py b/src/backend/getnews.py index cce7bcb..f222978 100644 --- a/src/backend/getnews.py +++ b/src/backend/getnews.py @@ -43,15 +43,15 @@ def mark_read(article_nr): if article_index in r_news_index: print( - f"\nArticle {sisyphus.getclr.green}{article_nr}{sisyphus.getclr.reset} is already marked as {sisyphus.getclr.green}read{sisyphus.getclr.reset}.") + f"\nArticle {sisyphus.getclr.bright_white}{article_nr}{sisyphus.getclr.reset} is already marked as {sisyphus.getclr.bright_green}read{sisyphus.getclr.reset}.") else: r_news_index.append(article_index) save_r_news(r_news_index) print( - f"\nArticle {sisyphus.getclr.green}{article_nr}{sisyphus.getclr.reset} marked as {sisyphus.getclr.green}read{sisyphus.getclr.reset}.") + f"\nArticle {sisyphus.getclr.bright_white}{article_nr}{sisyphus.getclr.reset} marked as {sisyphus.getclr.bright_green}read{sisyphus.getclr.reset}.") else: print( - f"\nArticle {sisyphus.getclr.green}{article_nr}{sisyphus.getclr.reset} doesn't exist.") + f"\nArticle {sisyphus.getclr.bright_white}{article_nr}{sisyphus.getclr.reset} doesn't exist.") def mark_unread(article_nr): @@ -63,15 +63,15 @@ def mark_unread(article_nr): if article_index not in r_news_index: print( - f"\nArticle {sisyphus.getclr.green}{article_nr}{sisyphus.getclr.reset} is already marked as {sisyphus.getclr.green}unread{sisyphus.getclr.reset}.") + f"\nArticle {sisyphus.getclr.bright_white}{article_nr}{sisyphus.getclr.reset} is already marked as {sisyphus.getclr.bright_red}unread{sisyphus.getclr.reset}.") else: r_news_index.remove(article_index) save_r_news(r_news_index) print( - f"\nArticle {sisyphus.getclr.green}{article_nr}{sisyphus.getclr.reset} marked as {sisyphus.getclr.green}unread{sisyphus.getclr.reset}.") + f"\nArticle {sisyphus.getclr.bright_white}{article_nr}{sisyphus.getclr.reset} marked as {sisyphus.getclr.bright_red}unread{sisyphus.getclr.reset}.") else: print( - f"\nArticle {sisyphus.getclr.green}{article_nr}{sisyphus.getclr.reset} doesn't exist.") + f"\nArticle {sisyphus.getclr.bright_white}{article_nr}{sisyphus.getclr.reset} doesn't exist.") def list_all_news(): @@ -79,9 +79,9 @@ def list_all_news(): r_news_index = ld_r_news() for index, news in enumerate(n_news): - status = "Read" if index in r_news_index else "Unread" + status = f"{sisyphus.getclr.bright_green}Read{sisyphus.getclr.reset}" if index in r_news_index else f"{sisyphus.getclr.bright_red}Unread{sisyphus.getclr.reset}" print( - f"\nArticle {sisyphus.getclr.green}{index + 1}{sisyphus.getclr.reset} ({status}):\n{news}") + f"\n{sisyphus.getclr.bright_yellow}Article {sisyphus.getclr.bright_white}{index + 1}{sisyphus.getclr.reset} ({status}):\n\n{news}") def start(list=False, read=False, unread=False, article_nr=None): @@ -91,11 +91,7 @@ def start(list=False, read=False, unread=False, article_nr=None): if read: if article_nr is not None: mark_read(article_nr) - else: - print("\nError: No article number provided to mark as read.") if unread: if article_nr is not None: mark_unread(article_nr) - else: - print("\nError: No article number provided to mark as unread.") |