mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-01 07:35:24 +08:00
Add missing annotations for psutil (#6124)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Callable, ContextManager, Iterable, Iterator, TypeVar
|
||||
from typing import Any, Callable, ContextManager, Iterable, Iterator, Tuple, TypeVar
|
||||
|
||||
from ._common import (
|
||||
AIX as AIX,
|
||||
@@ -97,6 +97,16 @@ if sys.platform == "win32":
|
||||
win_service_iter as win_service_iter,
|
||||
)
|
||||
|
||||
if sys.platform == "linux":
|
||||
from ._pslinux import pfullmem, pmem
|
||||
elif sys.platform == "darwin":
|
||||
from ._psosx import pfullmem, pmem
|
||||
elif sys.platform == "win32":
|
||||
from ._pswindows import pfullmem, pmem
|
||||
else:
|
||||
pmem = Any
|
||||
pfullmem = Any
|
||||
|
||||
if sys.platform == "linux":
|
||||
PROCFS_PATH: str
|
||||
AF_LINK: int
|
||||
@@ -106,20 +116,22 @@ __author__: str
|
||||
|
||||
class Process:
|
||||
def __init__(self, pid: int | None = ...) -> None: ...
|
||||
def __eq__(self, other) -> bool: ...
|
||||
def __ne__(self, other) -> bool: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@property
|
||||
def pid(self) -> int: ...
|
||||
def oneshot(self) -> ContextManager[None]: ...
|
||||
def as_dict(self, attrs: Any | None = ..., ad_value: Any | None = ...): ...
|
||||
def as_dict(
|
||||
self, attrs: list[str] | Tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ...
|
||||
) -> dict[str, Any]: ...
|
||||
def parent(self) -> Process: ...
|
||||
def parents(self) -> list[Process]: ...
|
||||
def is_running(self) -> bool: ...
|
||||
def ppid(self) -> int: ...
|
||||
def name(self) -> str: ...
|
||||
def exe(self) -> str: ...
|
||||
def cmdline(self): ...
|
||||
def cmdline(self) -> list[str]: ...
|
||||
def status(self) -> int: ...
|
||||
def username(self) -> str: ...
|
||||
def create_time(self) -> float: ...
|
||||
@@ -148,9 +160,9 @@ class Process:
|
||||
def children(self, recursive: bool = ...) -> list[Process]: ...
|
||||
def cpu_percent(self, interval: float | None = ...) -> float: ...
|
||||
def cpu_times(self) -> pcputimes: ...
|
||||
def memory_info(self): ...
|
||||
def memory_info_ex(self): ...
|
||||
def memory_full_info(self): ...
|
||||
def memory_info(self) -> pmem: ...
|
||||
def memory_info_ex(self) -> pmem: ...
|
||||
def memory_full_info(self) -> pfullmem: ...
|
||||
def memory_percent(self, memtype: str = ...) -> float: ...
|
||||
if sys.platform != "darwin":
|
||||
def memory_maps(self, grouped: bool = ...): ...
|
||||
@@ -173,7 +185,9 @@ class Popen(Process):
|
||||
|
||||
def pids() -> list[int]: ...
|
||||
def pid_exists(pid: int) -> bool: ...
|
||||
def process_iter(attrs: Any | None = ..., ad_value: Any | None = ...) -> Iterator[Process]: ...
|
||||
def process_iter(
|
||||
attrs: list[str] | Tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ...
|
||||
) -> Iterator[Process]: ...
|
||||
def wait_procs(
|
||||
procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], Any] | None = ...
|
||||
) -> tuple[list[Process], list[Process]]: ...
|
||||
|
||||
Reference in New Issue
Block a user