This repository has been archived by the owner on Dec 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
65 lines (50 loc) · 1.67 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
65
from TodaqAPI import *
def help_command():
print("ITEMS\t\tDisplay all the items on the marketplace\n"
"TRANSACTIONS\t\tDisplay all the transactions on the marketplace\n"
"USERS\t\tDisplay all the users on the marketplace\n"
"VAULT \t\tDisplay my marketplace vault")
def items_command():
print("Please wait for a sec...\n")
files = get_all_files()
print("Quant\t Items\n====================")
for file in files:
print("%sx\t\t %s" % (files[file], file))
def users_command():
users = get_accounts()
print("Users\n====================")
for user in users:
print(user)
def vault_command():
address = input("Enter your wallet address: ")
try:
files = get_files_from_account(address)
except Exception as error:
print(error)
return
if len(files) == 0:
print("Your vault is empty.")
print("Quant\t Items\n====================")
for file in files:
print("%sx\t\t %s" % (files[file], file))
if __name__ == '__main__':
print("Welcome to CS:GO Marketplace\n"
"For information on command, type HELP")
command = ""
while command != "EXIT":
user_input = input("> ")
command = user_input.strip(' \t\n\r').upper()
if len(command) == 0:
pass
elif command == "HELP":
help_command()
elif command == "ITEMS":
items_command()
elif command == "TRANSACTIONS":
pass
elif command == "USERS":
users_command()
elif command == "VAULT":
vault_command()
else:
print("%s: command not found" % user_input)