-
Notifications
You must be signed in to change notification settings - Fork 0
/
program.py
49 lines (37 loc) · 1.16 KB
/
program.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
import program_tmembers
import program_tmakers
import data.mongo_setup as mongo_setup
from colorama import Fore
def main():
mongo_setup.global_init()
print_header()
try:
while True:
if find_user_intent() == 'book': #if the user wants to find an event
program_tmembers.run()
else:
program_tmakers.run() #if the user wants to create an event.
except KeyboardInterrupt:
return
def print_header():
sport = \
"""
~ SPORT COMPANION ~
Find a sportive person near you """
print(Fore.WHITE + '**************** SPORT COMPANION ****************')
print(Fore.GREEN + sport)
print(Fore.WHITE + '*********************************************')
print()
print("Welcome to Sport Companion!")
print("What would you like to do?")
print()
def find_user_intent():
print("[m] Create a sport event at a place")
print("[mem] Look for a sport events near your place")
print()
choice = input("Are you a team[m]aker or team [mem]ber ? ")
if choice == 'm':
return 'offer'
return 'book'
if __name__ == '__main__':
main()