-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhead.py
74 lines (63 loc) · 2.49 KB
/
head.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
69
70
71
72
73
74
# head.py
"""
This will be where you call functions via a list of available actions.
"""
import accounts
import credentials
import emoji_id
base_url = 'https://a.y.at'
print("LET THERE BE YAT!")
print("♾️💻⛓️💻♾️")
def user_request (user_input):
print("Type 'help' for a list of commands.")
if user_input == 'help':
print("Available Commands:")
print("help : print this list")
print("login : login to a yat account:")
print("yat lookup : lookup the info of a yat")
print("exit : exit program")
return()
elif user_input == 'login':
account_info = accounts.select_account(base_url) # Returns a dictonary of account info
print("sending account info to credentials...")
logged_in, account = credentials.login(base_url, account_info)
if logged_in: # If log in successful it will take to logged in menu
logged_in_menu(account) # This menu will have tools avaliable when auththenticated by apiKey
else:
print("login failed")
elif user_input == 'yat lookup':
emoji_id.lookup(base_url)
elif user_input == 'exit':
exit() # should also revoke all access and log out of yat or whatever.
return()
def logged_in_menu(account):
print("Type 'help' for a list of commands.")
while True:
user_input = input(": ")
if user_input == 'help':
print("help : print this message")
print("list yats : list owned yats")
print("yat lookup : lookup the info of a yat")
print("char : valid emoji characters")
print("set : set yat record")
print("delete : delete hash data")
print("calc rs : calculate a yat RS")
print("logout : log out of this account")
elif user_input == 'list yats':
emoji_id.owned_list(base_url, account)
elif user_input == 'yat lookup':
emoji_id.lookup(base_url)
elif user_input == 'char':
emoji_id.emoji_characters(base_url, account)
elif user_input == 'set':
emoji_id.store(base_url, account)
elif user_input == 'delete':
emoji_id.delete_hash(base_url, account)
elif user_input == 'calc rs':
emoji_id.calc_rs(base_url)
elif user_input == 'logout':
return()
while True:
print("Type 'help' for a list of commands.")
user_input = input(": ")
user_request(user_input)