summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-02-06 02:10:04 +0000
committerV3n3RiX <venerix@koprulu.sector>2025-02-06 02:10:04 +0000
commit3a39631583e48b75ada47b44b0b2ae162ef72794 (patch)
tree29215ab728a0df937c85002078efa5881750a9ad /src
parent60acbaac2b8dbe7dc4998f06c794b7372c9d1f44 (diff)
backend : syncall, port to colorama API
Diffstat (limited to 'src')
-rw-r--r--src/backend/syncall.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/backend/syncall.py b/src/backend/syncall.py
index ac53d13..b7243f5 100644
--- a/src/backend/syncall.py
+++ b/src/backend/syncall.py
@@ -1,15 +1,18 @@
#!/usr/bin/python3
import animation
+import colorama
import os
import signal
import sys
import time
import sisyphus.checkenv
-import sisyphus.getclr
import sisyphus.getenv
import sisyphus.syncdb
import sisyphus.syncenv
+from colorama import Fore, Back, Style
+
+colorama.init()
def sigint_handler(signal, frame):
@@ -44,7 +47,7 @@ def start(gfx_ui=False):
os.kill(os.getpid(), signal.SIGTERM) # kill GUI window
else:
print(
- f"{sisyphus.getclr.bright_red}\nNo internet connection detected; Aborting!\n{sisyphus.getclr.reset}")
+ f"{Fore.RED}{Style.BRIGHT}\nNo internet connection detected; Aborting!\n{Style.RESET_ALL}")
sys.exit()
else:
if is_sane == 1:
@@ -54,10 +57,10 @@ def start(gfx_ui=False):
else:
if unread_count > 0:
print(
- f"\n\nThere are {sisyphus.getclr.bright_red}{unread_count}{sisyphus.getclr.reset} unread news article(s).")
+ f"\n\nThere are {Fore.RED}{Style.BRIGHT}{unread_count}{Style.RESET_ALL} unread news article(s).")
else:
print(
- f"\n\nThere are {sisyphus.getclr.green}{unread_count}{sisyphus.getclr.reset} unread news article(s).")
+ f"\n\nThere are {Fore.GREEN}{unread_count}{Style.RESET_ALL} unread news article(s).")
else:
if gfx_ui:
if "packages-next" in bhst_addr:
@@ -79,17 +82,17 @@ def start(gfx_ui=False):
else:
if "packages-next" in bhst_addr:
print(
- f"{sisyphus.getclr.green}\n\nThe active branch is '{actv_brch}' (stable){sisyphus.getclr.reset}")
+ f"{Fore.GREEN}\n\nThe active branch is '{actv_brch}' (stable){Style.RESET_ALL}")
print(
- f"{sisyphus.getclr.green}The active binhost is '{bhst_addr}' (testing){sisyphus.getclr.reset}")
+ f"{Fore.GREEN}The active binhost is '{bhst_addr}' (testing){Style.RESET_ALL}")
else:
print(
- f"{sisyphus.getclr.green}\n\nThe active branch is '{actv_brch}' (testing){sisyphus.getclr.reset}")
+ f"{Fore.GREEN}\n\nThe active branch is '{actv_brch}' (testing){Style.RESET_ALL}")
print(
- f"{sisyphus.getclr.green}The active binhost is '{bhst_addr}' (stable){sisyphus.getclr.reset}")
+ f"{Fore.GREEN}The active binhost is '{bhst_addr}' (stable){Style.RESET_ALL}")
print(
- f"{sisyphus.getclr.bright_red}\nInvalid configuration!{sisyphus.getclr.reset}")
+ f"{Fore.RED}{Style.BRIGHT}\nInvalid configuration!{Style.RESET_ALL}")
print(
- f"{sisyphus.getclr.bright_yellow}\nUse{sisyphus.getclr.reset} 'sisyphus branch --help' for assistance; Aborting.\n")
+ f"{FORE.WHITE}{Style.BRIGHT}\nUse 'sisyphus branch --help' for assistance; Aborting.{Style.RESET_ALL}\n")
sys.exit()