Fix typo
This commit is contained in:
parent
1cb30fb282
commit
057f2f7625
10
app.py
10
app.py
|
@ -155,18 +155,22 @@ def ships(request):
|
||||||
@app.route("/ships/(?P<ship>[^/]+)(?:/(?:index\.gmi)?)?")
|
@app.route("/ships/(?P<ship>[^/]+)(?:/(?:index\.gmi)?)?")
|
||||||
@wrap_response()
|
@wrap_response()
|
||||||
def ship(request,ship=None):
|
def ship(request,ship=None):
|
||||||
|
global DESC_PRE_SHIPS
|
||||||
if ship is None: return Response(Status.BAD_REQUEST,"Bad Request")
|
if ship is None: return Response(Status.BAD_REQUEST,"Bad Request")
|
||||||
|
print(ship)
|
||||||
ship_unquoted = urllib.parse.unquote(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")
|
if not os.path.isdir(os.path.join("/var/gopher",ship_unquoted)): return Response(Status.NOT_FOUND,"Not Found")
|
||||||
|
print("generator")
|
||||||
def __generator():
|
def __generator():
|
||||||
description = os.path.join("/var/gopher",ship_unquoted,".description")
|
description = os.path.join("/var/gopher",ship_unquoted,".description")
|
||||||
if os.path.exists(description):
|
if os.path.exists(description):
|
||||||
if ship_unquoted in DESC_PRE:
|
if ship_unquoted in DESC_PRE_SHIPS:
|
||||||
yield "```"
|
yield "```"
|
||||||
yield DESC_PRE[ship_unquoted]
|
yield DESC_PRE_SHIPS[ship_unquoted]
|
||||||
yield "\n"
|
yield "\n"
|
||||||
yield from app.load_file(description)
|
yield from app.load_file(description)
|
||||||
if ship_unquoted in DESC_PRE:
|
if ship_unquoted in DESC_PRE_SHIPS:
|
||||||
yield "```"
|
yield "```"
|
||||||
yield "\n"
|
yield "\n"
|
||||||
if os.path.exists(os.path.join("/var/gopher",ship_unquoted,"ABOUT")):
|
if os.path.exists(os.path.join("/var/gopher",ship_unquoted,"ABOUT")):
|
||||||
|
|
Loading…
Reference in New Issue