8000 Add type information for asyncio.subprocess · python/typeshed@c97acf2 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit c97acf2

Browse files
David Soria ParraDavid Soria Parra
authored andcommitted
Add type information for asyncio.subprocess
1 parent 030d9a3 commit c97acf2

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

stdlib/3.4/asyncio/__init__.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ from asyncio.streams import (
1919
IncompleteReadError as IncompleteReadError,
2020
LimitOverrunError as LimitOverrunError,
2121
)
22+
from asyncio.subprocess import (
23+
create_subprocess_exec as create_subprocess_exec,
24+
create_subprocess_shell as create_subprocess_shell,
25+
)
2226
from asyncio.transports import (
2327
BaseTransport as BaseTransport,
2428
ReadTransport as ReadTransport,
@@ -59,6 +63,7 @@ from asyncio.queues import (
5963
__all__ = (coroutines.__all__ +
6064
protocols.__all__ +
6165
streams.__all__ +
66+
subprocess.__all__ +
6267
transports.__all__ +
6368
futures.__all__ +
6469
tasks.__all__ +

stdlib/3.4/asyncio/subprocess.pyi

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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

Comments
 (0)
0