-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
74 lines (57 loc) · 1.89 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
66
67
68
69
70
71
72
73
74
""" The python file allowing the user to interface with the
facebook classes.
Developer:
"""
import os
from facebook.User import User
from facebook.Group import Group
from facebook.Timeline import Timeline
from facebook.Database import Database
from facebook.Interface import *
if __name__ == '__main__':
database = Database()
while True:
user = None
print("Welcome to facebook!")
print("1. Log in")
print("2. Sign up")
print("0. exit")
opt = int(input("Option: "))
clear_screen()
if opt == 0:
exit()
elif opt == 1:
user_name = input("Username: ")
user = database.getUser(user_name)
elif opt == 2:
print("Sign up!! (by giving us your information your soul belong to us eternally)")
name = input("Name: ")
birthday = input("Birthday: ")
location = input("Location: ")
user = User(name, birthday, location)
database.add("users", user)
else:
print("Please enter a valid option")
continue
while True and not user == None :
clear_screen()
print("What would you like see?")
print("0. log out")
print("1. my timeline")
print("2. my friends")
print("3. my groups")
print("4. my profile")
switcher = {
1: showTimelineActions,
2: showFriendsActions,
3: showGroupsActions,
4: showProfileMethods
}
opt = int(input("Option: "))
if opt == 0:
break
elif opt > 0 and opt <= 4:
function = switcher[opt]
function(user)
else:
print("invalid option! please select a valid option")