Formatting and remove debug prints

This commit is contained in:
Paul Bienkowski 2021-11-27 20:15:36 +01:00
parent bf1536f443
commit 6ed9edf191
2 changed files with 2 additions and 5 deletions

View file

@ -157,7 +157,7 @@ if INDEX_HTML and exists(INDEX_HTML):
@app.get("/config.json") @app.get("/config.json")
def get_frontend_config(req): def get_frontend_config(req):
base_path = req.server_path.replace("config.json", "") base_path = req.server_path.replace("config.json", "")
scheme = 'https' if req.app.config.FRONTEND_HTTPS else req.scheme scheme = "https" if req.app.config.FRONTEND_HTTPS else req.scheme
result = { result = {
**req.app.config.FRONTEND_CONFIG, **req.app.config.FRONTEND_CONFIG,
"apiUrl": f"{scheme}://{req.host}{base_path}api", "apiUrl": f"{scheme}://{req.host}{base_path}api",
@ -172,7 +172,7 @@ if INDEX_HTML and exists(INDEX_HTML):
], ],
"minzoom": 12, "minzoom": 12,
"maxzoom": 14, "maxzoom": 14,
} },
} }
return json_response(result) return json_response(result)

View file

@ -14,13 +14,11 @@ def get_tile(filename, zoom, x, y):
https://github.com/TileStache/TileStache/blob/master/TileStache/MBTiles.py https://github.com/TileStache/TileStache/blob/master/TileStache/MBTiles.py
""" """
print(filename)
db = connect(filename) db = connect(filename)
db.text_factory = bytes db.text_factory = bytes
fmt = db.execute("SELECT value FROM metadata WHERE name='format'").fetchone()[0] fmt = db.execute("SELECT value FROM metadata WHERE name='format'").fetchone()[0]
if fmt != b"pbf": if fmt != b"pbf":
print(repr(b"pbf"), " versus ", repr(fmt))
raise ValueError("mbtiles file is in wrong format: %s" % fmt) raise ValueError("mbtiles file is in wrong format: %s" % fmt)
content = db.execute( content = db.execute(
@ -51,7 +49,6 @@ async def tiles(req, zoom: int, x: int, y: str):
y=int(y), y=int(y),
) )
) )
print("TILE", tile)
gzip = "gzip" in req.headers["accept-encoding"] gzip = "gzip" in req.headers["accept-encoding"]