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)?)?")
|
||||
@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")):
|
||||
|
|
Loading…
Reference in New Issue