-
Notifications
You must be signed in to change notification settings - Fork 0
/
tools.py
44 lines (37 loc) · 1.17 KB
/
tools.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/python3
import sys
try:
import os, re, threading, math, requests, click, time
from tqdm import tqdm
except:
print("One of the modules has not been imported\nEnsure the following modules are installed:\nos, re, threading, math, requests, click, time")
class textEffects:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
def formatText(self, operation, text):
return getattr(self, operation) + text + self.END
def printText(text, asciiArt=False, font="banner3"):
if "pyfiglet" in sys.modules and asciiArt:
output = Figlet(font=font)
print(output.renderText(text))
else:
print(text)
def downloadDirectory():
desktopPath = os.path.join(os.path.expanduser("~"), "Desktop")
downloadFolder = os.path.join(desktopPath, "Downloads by Tachyon")
if not os.path.exists(downloadFolder):
try:
os.makedirs(downloadFolder)
return downloadFolder
except:
return None
else:
return downloadFolder