|
| 1 | +from typing import Any, AnyStr, Tuple |
| 2 | + |
| 3 | +__all__ = ['create_subprocess_exec', 'create_subprocess_shell'] |
| 4 | + |
| 5 | +from asyncio import events |
| 6 | +from asyncio import protocols |
| 7 | +from asyncio import streams |
| 8 | +from asyncio import transports |
| 9 | +from asyncio.coroutines import coroutine |
| 10 | + |
| 11 | + |
| 12 | +PIPE = ... # type: int |
| 13 | +STDOUT = ... # type: int |
| 14 | +DEVNULL = ... # type: int |
| 15 | + |
| 16 | +class SubprocessStreamProtocol(streams.FlowControlMixin, |
| 17 | + protocols.SubprocessProtocol): |
| 18 | + def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ... |
| 19 | + def connection_made(self, transport: transports.BaseTransport) -> None: ... |
| 20 | + def pipe_data_received(self, fd: int, data: AnyStr) -> None: ... |
| 21 | + def pipe_connection_lost(self, fd: int, exc: Exception): ... |
| 22 | + def process_exited(self) -> None: ... |
| 23 | + |
| 24 | + |
| 25 | +class Process: |
| 26 | + def __init__(self, |
| 27 | + transport: transports.BaseTransport, |
| 28 | + protocol: protocols.BaseProtocol, |
| 29 | + loop: events.AbstractEventLoop) -> None: ... |
| 30 | + @property |
| 31 | + def returncode(self) -> int: ... |
| 32 | + @coroutine |
| 33 | + def wait(self) -> int: ... |
| 34 | + def send_signal(self, signal: int) -> None: ... |
| 35 | + def terminatate(self) -> None: ... |
| 36 | + def kill(self) -> None: ... |
| 37 | + @coroutine |
| 38 | + def communicate(self, input: AnyStr = ...) -> Tuple[AnyStr, AnyStr]: ... |
| 39 | + |
| 40 | + |
| 41 | +@coroutine |
| 42 | +def create_subprocess_shell( |
| 43 | + *Args: AnyStr, |
| 44 | + stdin: int = ..., |
| 45 | + stdout: int = ..., |
| 46 | + stderr: int = ..., |
| 47 | + loop: events.AbstractEventLoop = ..., |
| 48 | + limit: int = ..., |
| 49 | + **kwds: Any): ... |
| 50 | + |
| 51 | +@coroutine |
| 52 | +def create_subprocess_exec( |
| 53 | + program: AnyStr, |
| 54 | + *args: Any, |
| 55 | + stdin: int = ..., |
| 56 | + stdout: int = ..., |
| 57 | + stderr: int = ..., |
| 58 | + loop: events.AbstractEventLoop = ..., |
| 59 | + limit: int = ..., |
| 60 | + **kwds: Any) -> Process: ... |
0 commit comments