-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver_data.py
More file actions
172 lines (147 loc) · 3.24 KB
/
server_data.py
File metadata and controls
172 lines (147 loc) · 3.24 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# ============================ DATA =================================== #
# This file contains global data variables
# ===================================================================== #
global data
data = {
"n_users" : 0,
"users" : [],
"n_channels" : 0,
"channels" : [],
"n_messages" : 0
}
'''
Below is sample data used for testing and data reference
data = {
"n_users" : 2,
"users" : [{
'token': 'valid_token',
'email': 'testsubject@email.com',
'password': 'valid_password',
'name_first': 'test',
'name_last': 'subject',
'handle_str' : 'test_handle',
'u_id': 0,
'channels':[ 0 ],
'permission':'',
}],
"n_channels": 2,
"channels": [
{
"channel_id": 0,
"name": "name",
"members": [
{
'u_id': '0',
'channel_permission': '1',
}
],
"messages" : [
{
"msg_id": 0,
"u_id": 0,
"message": "hello world",
"time_created": 1,
"reacts" : [],
"is_pinned" : False
},
{
"msg_id": 1,
"u_id": 0,
"message": "Another message",
"time_created": 2,
"reacts" : [],
"is_pinned" : False
}
],
"is_public" : True
},
{
"channel_id": 1,
"name": "name1",
"members": [
{
'u_id': '1',
'channel_permission': '1',
}
],
"messages" : [],
"is_public" : False
},
],
"n_messages" : 2
}
'''
global user_list
global channels_list
global owner_list
user_list = data['users']
channels_list = data['channels']
global messages_later
messages_later = []
global standups
standups = []
'''
# Users (in 'users' list)
user = {
'token': '',
'email': '',
'password': '',
'first_name': '',
'last_name': '',
'u_id': '',
'channels':'',
'slackr_permission':'',
}
# Channels (in 'channels' list)
channel = {
'channel_name': '',
'channel_id':'',
'members':[],
'owners':[],
'is_public': False,
'messages': [],
'n_messages': 0,
}
# Messages (in channel info)
message = {
'msg_id':,
'u_id':,
'message':,
'time_created':,
'reacts': [],
'is_pinned': False,
}
# Messages (in messages_later)
message = {
'msg_id':,
'u_id':,
'message':,
'time_created':,
'reacts': [],
'channel_id':,
'is_pinned': False,
}
# In 'members' list inside a channel dictionary
{
'u_id': '',
'channel_permission': '',
}
# messages (in data list)
message = {
'message_id': '',
'u_id': '',
'message':'',
'time_created':'',
'reacts':[],
'is_pinned':
}
# reacts (in "messages" list)
# u_ids is a list of all u_id who have reacted to the comment
react = {
'react_id': '',
'u_ids': [],
'is_this_user_reacted':
}
'''
if __name__ == '__main__':
pass