-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathutils.py
executable file
·68 lines (58 loc) · 1.62 KB
/
utils.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from shutil import which
import os
def credz():
print("___________________________________")
print(" _ _ _ _ _ __")
print(" /_\ _ _ (_)_ __ ___| | || |/ /")
print(" / _ \| ' \| | ' \/ -_)_ _| ' < ")
print("/_/ \_\_||_|_|_|_|_\___| |_||_|\_\\")
print("___________________________________")
print(" Upscale your Favorite Anime! ")
print(" Made by ThoughtfulDev ")
print("\n")
def is_tool(name):
return which(name) is not None
def langToShort(lang):
if lang == 'English':
return "eng"
elif lang == 'Japanese':
return "jpn"
elif lang == 'German':
return "ger"
elif lang == 'Korean':
return "kor"
else:
return "und"
def shortToLong(lang):
if lang == "eng":
return "English"
elif lang == "jpn" or lang == "jap" or lang == "ja":
return "Japanese"
elif lang == "fra":
return "French"
elif lang == "ger":
return "German"
elif lang == "kor":
return "Korean"
else:
return "Unknown"
language_mapping = {
"eng": "English",
"ja": "Japanese",
"jp": "Japanese",
"jap": "Japanese",
"jpn": "Japanese",
"ger": "German",
"kor": "Korean",
}
def clear():
os.system('cls' if os.name == 'nt' else 'clear')
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')