Improves psutil/_common.pyi (#6010)

* Improves `psutil/_common.pyi`

In this iteration I've fixed the most obvious types and corrected several mistakes.
We can go deeper in the next iteration(s).

* We don't need to import `Union`

* Update _common.pyi

* Update _common.pyi

* Update _common.pyi
This commit is contained in:
Nikita Sobolev
2021-09-06 21:37:53 +03:00
committed by GitHub
parent d8ec167681
commit 6188a3eec7

View File

@@ -1,17 +1,17 @@
import enum
from typing import Any, NamedTuple
from typing import Any, Callable, NamedTuple, TypeVar
POSIX: Any
WINDOWS: Any
LINUX: Any
MACOS: Any
OSX: Any
FREEBSD: Any
OPENBSD: Any
NETBSD: Any
BSD: Any
SUNOS: Any
AIX: Any
POSIX: bool
WINDOWS: bool
LINUX: bool
MACOS: bool
OSX: bool
FREEBSD: bool
OPENBSD: bool
NETBSD: bool
BSD: bool
SUNOS: bool
AIX: bool
STATUS_RUNNING: str
STATUS_SLEEPING: str
STATUS_DISK_SLEEP: str
@@ -54,8 +54,8 @@ class BatteryTime(enum.IntEnum):
POWER_TIME_UNKNOWN: int
POWER_TIME_UNLIMITED: int
ENCODING: Any
ENCODING_ERRS: Any
ENCODING: str
ENCODING_ERRS: str
class sswap(NamedTuple):
total: Any
@@ -239,16 +239,19 @@ class TimeoutExpired(Error):
name: Any
def __init__(self, seconds, pid: Any | None = ..., name: Any | None = ...) -> None: ...
def usage_percent(used, total, round_: Any | None = ...): ...
def memoize(fun): ...
def isfile_strict(path): ...
def path_exists_strict(path): ...
def supports_ipv6(): ...
_Func = TypeVar("_Func", bound=Callable[..., Any])
def usage_percent(used, total, round_: int | None = ...) -> float: ...
def memoize(fun: _Func) -> _Func: ...
def memoize_when_activated(fun: _Func) -> _Func: ...
def isfile_strict(path) -> bool: ...
def path_exists_strict(path) -> bool: ...
def supports_ipv6() -> bool: ...
def parse_environ_block(data): ...
def sockfam_to_enum(num): ...
def socktype_to_enum(num): ...
def conn_to_ntuple(fd, fam, type_, laddr, raddr, status, status_map, pid: Any | None = ...): ...
def deprecated_method(replacement): ...
def deprecated_method(replacement: str) -> Callable[[_Func], _Func]: ...
class _WrapNumbers:
lock: Any
@@ -261,8 +264,9 @@ class _WrapNumbers:
def cache_info(self): ...
def wrap_numbers(input_dict, name): ...
def bytes2human(n, format: str = ...): ...
def term_supports_colors(file=...): ...
def hilite(s, color: Any | None = ..., bold: bool = ...): ...
def print_color(s, color: Any | None = ..., bold: bool = ..., file=...) -> None: ...
def bytes2human(n: int, format: str = ...) -> str: ...
def get_procfs_path(): ...
def term_supports_colors(file=...) -> bool: ...
def hilite(s: str, color: str | None = ..., bold: bool = ...) -> str: ...
def print_color(s: str, color: str | None = ..., bold: bool = ..., file=...) -> None: ...
def debug(msg) -> None: ...