Skip to content
Snippets Groups Projects
Commit b7f1a824 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Code cleanup

parent c5bf0f87
Branches
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ async def connect_stdin_stdout():
writer = asyncio.StreamWriter(w_transport, w_protocol, reader, loop)
return reader, writer
class Socket():
class Socket:
async def write():
raise NotImplementedError
async def read():
......@@ -82,7 +82,7 @@ class UnixSocket(AsincioStreamSocket):
class MsgParser():
class MsgParser:
def __init__(self, socket):
self.socket = socket
self.buffer = []
......@@ -116,11 +116,11 @@ def msg(head, data):
assert head
return int_to_str_len(len(head), 5).encode('utf-8') + int_to_str_len(len(data), 12).encode('utf-8') + head + data
class WaitingQuestion():
class WaitingQuestion:
def __init__(self, id):
self.future = asyncio.get_running_loop().create_future()
class Client():
class Client:
def __init__(self, socket):
self.socket = socket
self.msg_parser = MsgParser(socket)
......@@ -151,7 +151,7 @@ class Client():
# eprint(asyncio.all_tasks())
return await q.future
class Server():
class Server:
def __init__(self, socket, callback):
self.socket = socket
self.msg_parser = MsgParser(socket)
......@@ -172,7 +172,7 @@ class Server():
def cbor_dump(x):
return cbor2.dumps(x, timezone=local_timezone)
class FuncCaller():
class FuncCaller:
def __init__(self, socket=None, is_server=False):
if socket == None:
is_server = True
......
......@@ -47,7 +47,7 @@ class TripStop:
shape_dist_traveled: float
class GtfsDay():
class GtfsDay:
def __init__(self, date, data_getter):
self.date = date
self.data_getter = data_getter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment