More python3 updates
This commit is contained in:
parent
7de3708efa
commit
95142e45ee
2
test.py
2
test.py
@ -957,7 +957,7 @@ class ParseScreenObstructions:
|
||||
doc = None
|
||||
for key in lud:
|
||||
#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)
|
||||
break
|
||||
else:
|
||||
|
@ -29,12 +29,12 @@ class MainHandler(BaseHTTPRequestHandler):
|
||||
|
||||
def do_POST(self):
|
||||
print("____")
|
||||
query = urlparse.urlparse(self.path).query
|
||||
query = urlparse(self.path).query
|
||||
if query.strip():
|
||||
query_components = dict(qc.split("=") for qc in query.split("&"))
|
||||
else:
|
||||
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);
|
||||
doc = json.loads(data)
|
||||
|
||||
@ -92,7 +92,7 @@ class MainHandler(BaseHTTPRequestHandler):
|
||||
print((len(output), time.time()-t_time))
|
||||
self.send_header("Content-Length", len(output))
|
||||
self.end_headers()
|
||||
self.wfile.write(output)
|
||||
self.wfile.write(bytes(output, encoding='utf-8'))
|
||||
|
||||
|
||||
def main():
|
||||
|
Loading…
Reference in New Issue
Block a user