update ircstates to v0.11.1, manually parse_tokens()

This commit is contained in:
jesopo 2020-08-07 15:00:02 +00:00
parent 77ae261bec
commit 28faec42fa

View file

@ -202,7 +202,7 @@ class Server(IServer):
line = await self.wait_for(end) line = await self.wait_for(end)
async def _next_lines(self) -> AsyncIterable[Tuple[Line, Optional[Emit]]]: async def _next_lines(self) -> AsyncIterable[Line]:
ping_sent = False ping_sent = False
while True: while True:
try: try:
@ -225,8 +225,8 @@ class Server(IServer):
self.disconnected = True self.disconnected = True
raise raise
for both in lines: for line in lines:
yield both yield line
async def _line_or_wait(self, async def _line_or_wait(self,
line_aw: asyncio.Task line_aw: asyncio.Task
@ -246,8 +246,8 @@ class Server(IServer):
async def _read_lines(self) -> AsyncIterable[Tuple[Line, Optional[Emit]]]: async def _read_lines(self) -> AsyncIterable[Tuple[Line, Optional[Emit]]]:
async with anyio.create_task_group() as tg: async with anyio.create_task_group() as tg:
async for both in self._next_lines(): async for line in self._next_lines():
line, emit = both emit = self.parse_tokens(line)
self.line_preread(line) self.line_preread(line)
for i, wait_for in enumerate(self._wait_fors): for i, wait_for in enumerate(self._wait_fors):
@ -263,7 +263,7 @@ class Server(IServer):
await new_wait await new_wait
await tg.spawn(_aw) await tg.spawn(_aw)
yield both yield (line, emit)
async def wait_for(self, async def wait_for(self,
response: Union[IMatchResponse, Set[IMatchResponse]], response: Union[IMatchResponse, Set[IMatchResponse]],