Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
real chads test in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
nyxiereal authored Sep 4, 2023
1 parent 16f7c5a commit 3c8a68a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from os import system
from requests import get, head
from rich.progress import Progress
from rich import print
from re import match as rematch
from subprocess import run, PIPE

Expand All @@ -13,13 +14,20 @@ def cls():
system('cls')

# Y/n quick question shortcut
def yn():
def ny():
inp = input('(N/y) ')
if inp.lower() == 'y':
return(True)
else:
return(False)

def yn():
inp = input('(Y/n) ')
if inp.lower() == 'n':
return(False)
else:
return(True)

# Downloads the file from any source
# Uses rich's progress bar tracking
def download(url, fnam, name):
Expand All @@ -32,7 +40,7 @@ def download(url, fnam, name):
total_size = int(response.headers.get("content-length", 0))

with Progress() as progress:
task = progress.add_task(f"[blue]:: Downloading {name}", total=total_size)
task = progress.add_task(f"[cyan]:: Downloading [bold]{name}[/bold][/cyan]", total=total_size)

with open(fnam, "wb") as file:

Expand Down

0 comments on commit 3c8a68a

Please sign in to comment.