1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-10 10:04:21 +01:00

Final touch to the UI

This commit is contained in:
Rnhmjoj 2014-12-03 23:01:51 +01:00
parent 9dd8960e36
commit b967607b5b

View File

@ -143,7 +143,7 @@ def print(*args, **kwargs):
colorama.init() colorama.init()
color_dict = { color_dict = {
"default": "", "default": "",
"header": colorama.Back.BLACK + colorama.Fore.BLUE, "header": colorama.Back.BLACK + colorama.Fore.WHITE,
"alt": colorama.Fore.YELLOW, "alt": colorama.Fore.YELLOW,
"zebra_0": "", "zebra_0": "",
"zebra_1": colorama.Fore.BLUE, "zebra_1": colorama.Fore.BLUE,
@ -475,8 +475,8 @@ def main():
# New input loop to support different link options # New input loop to support different link options
while True: while True:
try: try:
print("\nSelect links (Type 'h' for more options" print("\nSelect links (Type 'h' for more options" +
", 'q' to quit)", end="", color="alt") ", 'q' to quit)", end="\b", color="alt")
l=input(": ") l=input(": ")
except KeyboardInterrupt : except KeyboardInterrupt :
print("\nCancelled.") print("\nCancelled.")
@ -504,13 +504,13 @@ def main():
print("") print("")
if code == 'h': if code == 'h':
print("Options:", print("Options:",
"<links>: Download selected torrents", "<links>: Download selected torrents",
"[d<links>]: Get descriptions", "[d<links>]: Get descriptions",
"[f<links>]: Get files", "[f<links>]: Get files",
"[p] Print search results", "[p] Print search results",
"[q] Quit", sep="\n") "[q] Quit", sep="\n")
elif code == 'q': elif code == 'q':
print("User Cancelled.") print("Bye.", color="alt")
sys.exit(0) sys.exit(0)
elif code == 'd': elif code == 'd':
print_descriptions(choices, mags, site, identifiers) print_descriptions(choices, mags, site, identifiers)
@ -523,7 +523,7 @@ def main():
else: else:
break break
except Exception as e: except Exception as e:
print('Exception:') print('Exception:', color="ERROR")
print(str(e)) print(str(e))
choices = () choices = ()
sys.exit(1) sys.exit(1)