mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Process.status returns a status string (#6245)
Typed STATUS_* constants using Literal
This commit is contained in:
@@ -47,6 +47,7 @@ from ._common import (
|
||||
NoSuchProcess as NoSuchProcess,
|
||||
TimeoutExpired as TimeoutExpired,
|
||||
ZombieProcess as ZombieProcess,
|
||||
_Status,
|
||||
pconn,
|
||||
pcputimes,
|
||||
pctxsw,
|
||||
@@ -132,7 +133,7 @@ class Process:
|
||||
def name(self) -> str: ...
|
||||
def exe(self) -> str: ...
|
||||
def cmdline(self) -> list[str]: ...
|
||||
def status(self) -> int: ...
|
||||
def status(self) -> _Status: ...
|
||||
def username(self) -> str: ...
|
||||
def create_time(self) -> float: ...
|
||||
def cwd(self) -> str: ...
|
||||
|
||||
@@ -2,6 +2,7 @@ import enum
|
||||
from _typeshed import StrOrBytesPath, SupportsWrite
|
||||
from socket import AddressFamily, SocketKind
|
||||
from typing import Any, Callable, NamedTuple, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
POSIX: bool
|
||||
WINDOWS: bool
|
||||
@@ -14,20 +15,39 @@ NETBSD: bool
|
||||
BSD: bool
|
||||
SUNOS: bool
|
||||
AIX: bool
|
||||
STATUS_RUNNING: str
|
||||
STATUS_SLEEPING: str
|
||||
STATUS_DISK_SLEEP: str
|
||||
STATUS_STOPPED: str
|
||||
STATUS_TRACING_STOP: str
|
||||
STATUS_ZOMBIE: str
|
||||
STATUS_DEAD: str
|
||||
STATUS_WAKE_KILL: str
|
||||
STATUS_WAKING: str
|
||||
STATUS_IDLE: str
|
||||
STATUS_LOCKED: str
|
||||
STATUS_WAITING: str
|
||||
STATUS_SUSPENDED: str
|
||||
STATUS_PARKED: str
|
||||
|
||||
STATUS_RUNNING: Literal["running"]
|
||||
STATUS_SLEEPING: Literal["sleeping"]
|
||||
STATUS_DISK_SLEEP: Literal["disk-sleep"]
|
||||
STATUS_STOPPED: Literal["stopped"]
|
||||
STATUS_TRACING_STOP: Literal["tracing-stop"]
|
||||
STATUS_ZOMBIE: Literal["zombie"]
|
||||
STATUS_DEAD: Literal["dead"]
|
||||
STATUS_WAKE_KILL: Literal["wake-kill"]
|
||||
STATUS_WAKING: Literal["waking"]
|
||||
STATUS_IDLE: Literal["idle"]
|
||||
STATUS_LOCKED: Literal["locked"]
|
||||
STATUS_WAITING: Literal["waiting"]
|
||||
STATUS_SUSPENDED: Literal["suspended"]
|
||||
STATUS_PARKED: Literal["parked"]
|
||||
|
||||
_Status = Literal[
|
||||
"running",
|
||||
"sleeping",
|
||||
"disk-sleep",
|
||||
"stopped",
|
||||
"tracing-stop",
|
||||
"zombie",
|
||||
"dead",
|
||||
"wake-kill",
|
||||
"waking",
|
||||
"idle",
|
||||
"locked",
|
||||
"waiting",
|
||||
"suspended",
|
||||
"parked",
|
||||
]
|
||||
|
||||
CONN_ESTABLISHED: str
|
||||
CONN_SYN_SENT: str
|
||||
CONN_SYN_RECV: str
|
||||
|
||||
Reference in New Issue
Block a user