plugin-backend #1
@ -34,26 +34,26 @@ def session_key(session, key):
|
||||
def index(request):
|
||||
listen_address = session_key(request.session, "listen_address")
|
||||
|
||||
try:
|
||||
request_overview_data = requests.get(
|
||||
f"{listen_address}overview", timeout=5, verify=True
|
||||
).text
|
||||
request_items_data = requests.get(
|
||||
f"{listen_address}items", timeout=5, verify=True
|
||||
).text
|
||||
request_doors_data = requests.get(
|
||||
f"{listen_address}doors", timeout=5, verify=True
|
||||
).text
|
||||
request_hints_data = requests.get(
|
||||
f"{listen_address}hints", timeout=5, verify=True
|
||||
).text
|
||||
tracker_overview_data = loads(request_overview_data)
|
||||
if "error" in tracker_overview_data.keys():
|
||||
raise ValueError
|
||||
tracker_items_data = loads(request_items_data)
|
||||
tracker_doors_data = loads(request_doors_data)
|
||||
tracker_hints_data = loads(request_hints_data)
|
||||
except:
|
||||
# try:
|
||||
# request_overview_data = requests.get(
|
||||
# f"{listen_address}overview", timeout=5, verify=True
|
||||
# ).text
|
||||
# request_items_data = requests.get(
|
||||
# f"{listen_address}items", timeout=5, verify=True
|
||||
# ).text
|
||||
# request_doors_data = requests.get(
|
||||
# f"{listen_address}doors", timeout=5, verify=True
|
||||
# ).text
|
||||
# request_hints_data = requests.get(
|
||||
# f"{listen_address}hints", timeout=5, verify=True
|
||||
# ).text
|
||||
# tracker_overview_data = loads(request_overview_data)
|
||||
# if "error" in tracker_overview_data.keys():
|
||||
# raise ValueError
|
||||
# tracker_items_data = loads(request_items_data)
|
||||
# tracker_doors_data = loads(request_doors_data)
|
||||
# tracker_hints_data = loads(request_hints_data)
|
||||
# except:
|
||||
with open("empty_overview.json", "r") as t:
|
||||
tracker_overview_data = loads(t.read())
|
||||
with open("empty_items.json", "r") as t:
|
||||
|
Loading…
Reference in New Issue
Block a user