summaryrefslogtreecommitdiff
path: root/dashboard_website
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard_website')
-rw-r--r--dashboard_website/__pycache__/db.cpython-312.pycbin13912 -> 13992 bytes
-rw-r--r--dashboard_website/db.py12
-rw-r--r--dashboard_website/dirt.csv2
3 files changed, 8 insertions, 6 deletions
diff --git a/dashboard_website/__pycache__/db.cpython-312.pyc b/dashboard_website/__pycache__/db.cpython-312.pyc
index d281091..b064c16 100644
--- a/dashboard_website/__pycache__/db.cpython-312.pyc
+++ b/dashboard_website/__pycache__/db.cpython-312.pyc
Binary files differ
diff --git a/dashboard_website/db.py b/dashboard_website/db.py
index f49732e..86001a1 100644
--- a/dashboard_website/db.py
+++ b/dashboard_website/db.py
@@ -194,12 +194,12 @@ def getCluesJSON(timestamp):
return False
-def addClue(clue_name, clue_info, longitude, latitude, status="UNVISITED"):
+def addClue(clue_name, clue_info, longitude, latitude, status="UNVISITED", required=False):
global clues_last_changed, route_update_required, _clues_changed
for clue in clues:
if clue.name == clue_name:
return -1 # clue already exists
- newClue = Clue(latitude, longitude, clue_name, clue_info, status)
+ newClue = Clue(latitude, longitude, clue_name, clue_info, status, required)
clues.append(newClue)
clues_last_changed = time.time()
route_update_required = True
@@ -323,7 +323,7 @@ def load(filename=None):
status = row[4]
reqd = True if (row[5] == "True") else False
- clues.append(Clue(latitude, longitude, name, info, status, required=reqd))
+ addClue(name, info, longitude, latitude, "UNVISITED", required=reqd)
except:
return 1
clues_last_changed = time.time()
@@ -346,12 +346,14 @@ def loadDirty(filename=None):
name = row[0]
info = row[2]
latlong = row[3].split(",")
+ reqd = True if (row[4] == "True") else False
if len(latlong) != 2: continue
latitude = float(latlong[0])
longitude = float(latlong[1])
- clues.append(Clue(latitude, longitude, name, info, "UNVISITED"))
- except:
+ addClue(name, info, longitude, latitude, "UNVISITED", required=reqd)
+ except Exception as e:
+ print(e)
return 1
clues_last_changed = time.time()
route_update_required = True
diff --git a/dashboard_website/dirt.csv b/dashboard_website/dirt.csv
index 217b086..90bed28 100644
--- a/dashboard_website/dirt.csv
+++ b/dashboard_website/dirt.csv
@@ -1,4 +1,4 @@
-Clue ID,Clue,Name,"Latitude, Longitude (right click near place on google maps, then click the coordinates to copy)",,
+Clue ID,Clue,Name,"Latitude, Longitude (right click near place on google maps, then click the coordinates to copy)",Required,
A1,"1) Where Andrew, Tom, and Toby might toss a frisbee PETERS PARK BOSTON",Peters Park,"42.3430402738135, -71.0675801105357",,
A2,2) It's not North of Washington Street.... SOWA → South of Washington Street?,SoWa Market(?),,,
A3,"3) Blues, Latin jazz salsa, jazz xa, funk x3, 24/7/365 Wally’s Cafe Jazz club",Wally's Cafe Jazz Club,"42.340735169280684, -71.0822142949978",,