From 057f2f76259548f7d65e4ba356ef4b6a8cf75216 Mon Sep 17 00:00:00 2001 From: khuxkm fbexl Date: Wed, 13 Oct 2021 11:15:38 +0000 Subject: [PATCH] Fix typo --- app.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index b68fb64..d1e7807 100644 --- a/app.py +++ b/app.py @@ -155,18 +155,22 @@ def ships(request): @app.route("/ships/(?P[^/]+)(?:/(?:index\.gmi)?)?") @wrap_response() def ship(request,ship=None): + global DESC_PRE_SHIPS if ship is None: return Response(Status.BAD_REQUEST,"Bad Request") + print(ship) ship_unquoted = urllib.parse.unquote(ship) + print(ship_unquoted) if not os.path.isdir(os.path.join("/var/gopher",ship_unquoted)): return Response(Status.NOT_FOUND,"Not Found") + print("generator") def __generator(): description = os.path.join("/var/gopher",ship_unquoted,".description") if os.path.exists(description): - if ship_unquoted in DESC_PRE: + if ship_unquoted in DESC_PRE_SHIPS: yield "```" - yield DESC_PRE[ship_unquoted] + yield DESC_PRE_SHIPS[ship_unquoted] yield "\n" yield from app.load_file(description) - if ship_unquoted in DESC_PRE: + if ship_unquoted in DESC_PRE_SHIPS: yield "```" yield "\n" if os.path.exists(os.path.join("/var/gopher",ship_unquoted,"ABOUT")):