-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobals.py
28 lines (26 loc) · 827 Bytes
/
globals.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
import mysql.connector
messages = {}
pool_params = []
def init_globals():
global mysqld, messages, pool_params
messages['l'] = "You must be logged in to do that"
messages['ss'] = "Signup successful"
messages['ssu'] = "Signup unsuccessful"
messages['us'] = "Unsignup successful"
messages['usu'] = "Unsignup unsuccessful"
messages['af'] = "Please fill out all fields"
messages['pf'] = "Pool is full"
messages['bf'] = "One of your fields was in an incorrect format"
pool_params = ['pool_id', 'pool_size','pool_date','driver_id','leave_location','come_location','leave_time','come_time', 'comments']
mysqld = mysql.connector.connect(
host = "localhost",
user = "root",
passwd = "jinny2yoo",
database = "tjpool"
)
def get_message(m):
global messages
if m in messages:
return messages[m]
else:
return ''