Skip to content

Commit

Permalink
Add changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hdadhich01 committed Jan 14, 2024
1 parent 9576f3b commit 2bc5a12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
13 changes: 6 additions & 7 deletions app/blueprints/catalog/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# TODO: add name
def get_rooms_name(name, rooms):
res = extractOne(name, list(rooms.keys()))
res = extractOne(name, rooms.keys())
if not compile(r"\d").search(name):
abort(
400,
Expand All @@ -37,14 +37,15 @@ def get_rooms_name(name, rooms):
}
)
master = {
"name": res[0],
"link": rooms[res[0]],
"capacity": int(titles[0].text.split(" ")[-1]),
"facilityID": titles[1].text.split(": ")[-1],
"equipment": [readify(i.text) for i in soup.find_all("li")],
"cap": int(titles[1].text.split(": ")[1]),
"id": titles[0].text.split(": ")[1],
"equip": [readify(i.text) for i in soup.find_all("li")],
"notes": readify(
" ".join([i.text for i in soup.find("ul").findNext(["p", "span"])])
),
"images": images,
"imgs": images,
}
return master

Expand All @@ -65,8 +66,6 @@ def get_rmp(name):
match = pattern.search(tx)
if match:
content = loads(match.group(1))
with open("rmp.json", "w") as f:
f.write(str(content))
# using first match at index 4 (relative to sid query argument)
# if pushing pr to api library, access reference IDs to make list of teachers
content = next(islice(content.values(), 4, 5))
Expand Down
2 changes: 1 addition & 1 deletion app/blueprints/food/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def find_match(j, live, names):
match = extractOne(j["name"], names)
match = match[2] if match[1] > 90 else None
data = None
if match:
if match is not None:
# only invoke this req when found to prevent latency
comp = waitz.get("/compare/ucsc").json()["data"]
data = build_data(live[match], comp[match])
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

if __name__ == "__main__":
debug = True if "--debug" in sys.argv else False
app.run(debug=debug)
app.run(debug=debug, host="0.0.0.0")
1 change: 0 additions & 1 deletion rmp.json

This file was deleted.

0 comments on commit 2bc5a12

Please sign in to comment.