-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
45 lines (36 loc) · 1.12 KB
/
main.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
import os
from colorama import Fore
from lib.Log import Log
from lib.ClIHandle import ClIHandle
from lib.options import *
import asyncio
async def run():
cli = ClIHandle()
cli.add("chat", chat)
cli.add("set", selectChat)
cli.add("all", allChats)
cli.add("save", save)
cli.add("i", image)
cli.add("t", translate)
os.system('cls' if os.name == 'nt' else 'clear')
root_path = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(root_path, "logo.txt"), 'r') as file:
logo = file.read()
print(Fore.CYAN + logo)
while True:
Log.point("Next")
try:
user_input = input()
user_input = user_input.strip()
split_input = user_input.split()
option = split_input[0]
args = split_input[1:]
if option == "quit":
break
await cli.parse(option, *args)
except TypeError:
Log.error("Option does not exist or correct parameters were not entered")
except IndexError:
pass
loop = asyncio.get_event_loop()
loop.run_until_complete(run())