-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase_code.py
More file actions
37 lines (31 loc) · 1.07 KB
/
database_code.py
File metadata and controls
37 lines (31 loc) · 1.07 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
import twilio_functions as tw
import sys
import os
import time
import logging
from watchdog.observers import Observer
from watchdog.events import LoggingEventHandler
import check_in
#############################################################
###database triggers this code when status is changed to "out"
#############################################################
#if tw.check_user_status("out"): tw.checked_out()
#############################################################
#############################################################
# Additional goals: every X days the device uploads the entry/exit logs to cave/park management
def observed_change():
print("OK")
if __name__ == "__main__":
# path = os.path(__file__), "database.csv" #relative path
path = '/Users/Sonia/Development/AthenaHacks/database/database.csv'
observer = Observer()
observer.schedule(observed_change, path)
print("1")
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()
print("2")