-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
64 lines (50 loc) · 1.47 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import sys
import os
import argparse
from colorama import init as colorama_init
from termcolor import colored
from src.airdrops import create_wallet_entrance
from src.airdrops import set_trustline_entrance
from src.airdrops import create_order_entrance
from src.airdrops import cancel_order_entrance
parser = argparse.ArgumentParser(description='Set trustline for airdrop wallets')
parser.add_argument('--debug', '-D', dest='debug', help='Debug mode', action='store_true')
args = parser.parse_args()
main_debug = True if args.debug else False
colorama_init()
def clear():
if os.name == 'posix':
os.system('clear')
elif os.name == 'nt':
os.system('cls')
else:
pass
def decide(option: int):
if option == 1:
create_wallet_entrance.enter(main_debug)
elif option == 2:
set_trustline_entrance.enter(main_debug)
elif option == 3:
create_order_entrance.enter(main_debug)
elif option == 4:
cancel_order_entrance.enter(main_debug)
elif option == 0:
sys.exit()
def enter():
print(
"[01] \t [Create Wallet]\n"
"[02] \t [Set Trustline]\n"
"[03] \t [Create Order]\n"
"[04] \t [Cancel Order]\n"
"[00] \t [Exit]\n"
)
option = int(input("Enter option: "))
clear()
decide(option)
if __name__ == "__main__":
clear()
try:
enter()
except KeyboardInterrupt:
print(colored(text='\n\nExiting...', color='red'))
sys.exit()