More python3 updates

This commit is contained in:
Michael Taboada 2024-08-06 10:14:12 -07:00
parent 7de3708efa
commit 95142e45ee
2 changed files with 4 additions and 4 deletions

View File

@ -957,7 +957,7 @@ class ParseScreenObstructions:
doc = None doc = None
for key in lud: for key in lud:
#bmps are stored upside down, so do endswith here.. #bmps are stored upside down, so do endswith here..
if key.endswith(tile[-len(tile)*3/4:]): if key.endswith(tile[int(-len(tile)*3/4):]):
doc = lud.get(key) doc = lud.get(key)
break break
else: else:

View File

@ -29,12 +29,12 @@ class MainHandler(BaseHTTPRequestHandler):
def do_POST(self): def do_POST(self):
print("____") print("____")
query = urlparse.urlparse(self.path).query query = urlparse(self.path).query
if query.strip(): if query.strip():
query_components = dict(qc.split("=") for qc in query.split("&")) query_components = dict(qc.split("=") for qc in query.split("&"))
else: else:
query_components = {} query_components = {}
content_length = int(self.headers.getheader('content-length', 0)) content_length = int(self.headers.get('content-length', 0))
data = self.rfile.read(content_length); data = self.rfile.read(content_length);
doc = json.loads(data) doc = json.loads(data)
@ -92,7 +92,7 @@ class MainHandler(BaseHTTPRequestHandler):
print((len(output), time.time()-t_time)) print((len(output), time.time()-t_time))
self.send_header("Content-Length", len(output)) self.send_header("Content-Length", len(output))
self.end_headers() self.end_headers()
self.wfile.write(output) self.wfile.write(bytes(output, encoding='utf-8'))
def main(): def main():