next_line() doesn't need wait_for param

This commit is contained in:
jesopo 2020-04-05 17:22:33 +01:00
parent 423623fec1
commit d837529698

View file

@ -100,8 +100,7 @@ class Server(IServer):
async def line_read(self, line: Line): async def line_read(self, line: Line):
pass pass
async def next_line(self, wait_for: bool = False async def next_line(self) -> Tuple[Line, List[Emit]]:
) -> Tuple[Line, List[Emit]]:
if self._read_queue: if self._read_queue:
both = self._read_queue.popleft() both = self._read_queue.popleft()
else: else:
@ -119,10 +118,9 @@ class Server(IServer):
return both return both
async def wait_for(self, response: IMatchResponse) -> Line: async def wait_for(self, response: IMatchResponse) -> Line:
while True: while True:
both = await self.next_line(wait_for=True) both = await self.next_line()
line, emits = both line, emits = both
if response.match(self, line): if response.match(self, line):