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")):