Add type information for asyncio.subprocess

This commit is contained in:
David Soria Parra
2016-01-28 19:41:01 -08:00
parent bce32b0382
commit 3223a693d5
2 changed files with 65 additions and 0 deletions

View File

@@ -19,6 +19,10 @@ from asyncio.streams import (
IncompleteReadError as IncompleteReadError,
LimitOverrunError as LimitOverrunError,
)
from asyncio.subprocess import (
create_subprocess_exec as create_subprocess_exec,
create_subprocess_shell as create_subprocess_shell,
)
from asyncio.transports import (
BaseTransport as BaseTransport,
ReadTransport as ReadTransport,
@@ -58,6 +62,7 @@ from asyncio.queues import (
__all__ = (coroutines.__all__ +
protocols.__all__ +
streams.__all__ +
subprocess.__all__ +
transports.__all__ +
futures.__all__ +
tasks.__all__ +

View File

@@ -0,0 +1,60 @@
from typing import Any, AnyStr, Tuple
__all__ = ['create_subprocess_exec', 'create_subprocess_shell']
from asyncio import events
from asyncio import protocols
from asyncio import streams
from asyncio import transports
from asyncio.coroutines import coroutine
PIPE = ... # type: int
STDOUT = ... # type: int
DEVNULL = ... # type: int
class SubprocessStreamProtocol(streams.FlowControlMixin,
protocols.SubprocessProtocol):
def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ...
def connection_made(self, transport: transports.BaseTransport) -> None: ...
def pipe_data_received(self, fd: int, data: AnyStr) -> None: ...
def pipe_connection_lost(self, fd: int, exc: Exception): ...
def process_exited(self) -> None: ...
class Process:
def __init__(self,
transport: transports.BaseTransport,
protocol: protocols.BaseProtocol,
loop: events.AbstractEventLoop) -> None: ...
@property
def returncode(self) -> int: ...
@coroutine
def wait(self) -> int: ...
def send_signal(self, signal: int) -> None: ...
def terminatate(self) -> None: ...
def kill(self) -> None: ...
@coroutine
def communicate(self, input: AnyStr = ...) -> Tuple[AnyStr, AnyStr]: ...
@coroutine
def create_subprocess_shell(
*Args: AnyStr,
stdin: int = ...,
stdout: int = ...,
stderr: int = ...,
loop: events.AbstractEventLoop = ...,
limit: int = ...,
**kwds: Any): ...
@coroutine
def create_subprocess_exec(
program: AnyStr,
*args: Any,
stdin: int = ...,
stdout: int = ...,
stderr: int = ...,
loop: events.AbstractEventLoop = ...,
limit: int = ...,
**kwds: Any) -> Process: ...