Replace HTML newlines with actual newlines
This commit is contained in:
parent
bc3a402f1b
commit
2b4ef6406b
|
@ -26,9 +26,15 @@ def google_sheet_to_json(spreadsheet_id, range_name):
|
||||||
def create_point(row):
|
def create_point(row):
|
||||||
if (len(row) != 17):
|
if (len(row) != 17):
|
||||||
return None
|
return None
|
||||||
active, lat, lon, name, address, capacity, startdate, enddate, hours_monday, hours_tuesday, hours_wednesday, hours_thursday, hours_friday, hours_saturday, hours_sunday, extra, location_type = row
|
|
||||||
|
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
||||||
|
active, lat, lon, name, address, capacity, startdate, enddate, _, _, _, _, _, _, _, extra, location_type = row
|
||||||
|
|
||||||
if active == "FALSE":
|
if active == "FALSE":
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
hours = [x.replace("</br>", "\n") for x in row[8:15]]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"type": "Feature",
|
"type": "Feature",
|
||||||
"geometry": {
|
"geometry": {
|
||||||
|
@ -43,15 +49,11 @@ def create_point(row):
|
||||||
"start": startdate,
|
"start": startdate,
|
||||||
"end": enddate,
|
"end": enddate,
|
||||||
},
|
},
|
||||||
"hours": {
|
# We give dict an iterable of pairs, dict gives us a dict
|
||||||
"monday": hours_monday,
|
"hours": dict(zip(
|
||||||
"tuesday": hours_tuesday,
|
["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"],
|
||||||
"wednesday": hours_wednesday,
|
hours
|
||||||
"thursday": hours_thursday,
|
)),
|
||||||
"friday": hours_friday,
|
|
||||||
"saturday": hours_saturday,
|
|
||||||
"sunday": hours_sunday,
|
|
||||||
},
|
|
||||||
"extra": extra,
|
"extra": extra,
|
||||||
"type": location_type,
|
"type": location_type,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue