Skip to content
Snippets Groups Projects
Commit 9d4ab5ea authored by Jesse Nava's avatar Jesse Nava
Browse files

update for current dependencies

parent 13769fa2
No related branches found
No related tags found
No related merge requests found
...@@ -97,7 +97,7 @@ class ExecBot(Plugin): ...@@ -97,7 +97,7 @@ class ExecBot(Plugin):
or not evt.content.formatted_body)): or not evt.content.formatted_body)):
return return
command = EntityParser.parse(evt.content.formatted_body) command = await EntityParser().parse(evt.content.formatted_body)
entity: SimpleEntity entity: SimpleEntity
code: Optional[str] = None code: Optional[str] = None
lang: Optional[str] = None lang: Optional[str] = None
......
...@@ -33,9 +33,9 @@ class AsyncTextOutput: ...@@ -33,9 +33,9 @@ class AsyncTextOutput:
closed: bool closed: bool
def __init__(self, loop: Optional[AbstractEventLoop] = None) -> None: def __init__(self, loop: Optional[AbstractEventLoop] = None) -> None:
self.loop = loop or get_event_loop() self.loop = get_event_loop()
self.read_task = None self.read_task = None
self.queue = Queue(loop=self.loop) self.queue = Queue()
self.closed = False self.closed = False
def __aiter__(self) -> 'AsyncTextOutput': def __aiter__(self) -> 'AsyncTextOutput':
......
...@@ -80,7 +80,7 @@ class ShellRunner(Runner): ...@@ -80,7 +80,7 @@ class ShellRunner(Runner):
) -> AsyncGenerator[Tuple[OutputType, Union[str, int]], None]: ) -> AsyncGenerator[Tuple[OutputType, Union[str, int]], None]:
loop = loop or asyncio.get_event_loop() loop = loop or asyncio.get_event_loop()
output = AsyncTextProxy() output = AsyncTextProxy()
proc = await asyncio.create_subprocess_shell(code, loop=loop, proc = await asyncio.create_subprocess_shell(code,
stdin=asyncio.subprocess.PIPE, stdin=asyncio.subprocess.PIPE,
stdout=asyncio.subprocess.PIPE, stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE) stderr=asyncio.subprocess.PIPE)
...@@ -91,6 +91,7 @@ class ShellRunner(Runner): ...@@ -91,6 +91,7 @@ class ShellRunner(Runner):
waiter = asyncio.ensure_future(self._wait_proc(proc, output), loop=loop) waiter = asyncio.ensure_future(self._wait_proc(proc, output), loop=loop)
async for part in output: async for part in output:
yield part yield part
print(output)
yield (OutputType.RETURN, await waiter) yield (OutputType.RETURN, await waiter)
def format_exception(self, exc_info: Any) -> Tuple[Optional[str], Optional[str]]: def format_exception(self, exc_info: Any) -> Tuple[Optional[str], Optional[str]]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment