Backport platform specific code to python2 (#6772)

This commit is contained in:
Nikita Sobolev
2022-01-01 15:26:20 +03:00
committed by GitHub
parent 6bdc158e61
commit 6da5eb2d04
12 changed files with 583 additions and 576 deletions

View File

@@ -1,96 +1,96 @@
import sys
from types import TracebackType
from typing import Any, Tuple, Type, Union
_KeyType = Union[HKEYType, int]
if sys.platform == "win32":
_KeyType = Union[HKEYType, int]
def CloseKey(__hkey: _KeyType) -> None: ...
def ConnectRegistry(__computer_name: str | None, __key: _KeyType) -> HKEYType: ...
def CreateKey(__key: _KeyType, __sub_key: str | None) -> HKEYType: ...
def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = ..., access: int = ...) -> HKEYType: ...
def DeleteKey(__key: _KeyType, __sub_key: str) -> None: ...
def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ...
def DeleteValue(__key: _KeyType, __value: str) -> None: ...
def EnumKey(__key: _KeyType, __index: int) -> str: ...
def EnumValue(__key: _KeyType, __index: int) -> Tuple[str, Any, int]: ...
def ExpandEnvironmentStrings(__str: str) -> str: ...
def FlushKey(__key: _KeyType) -> None: ...
def LoadKey(__key: _KeyType, __sub_key: str, __file_name: str) -> None: ...
def OpenKey(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ...
def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ...
def QueryInfoKey(__key: _KeyType) -> Tuple[int, int, int]: ...
def QueryValue(__key: _KeyType, __sub_key: str | None) -> str: ...
def QueryValueEx(__key: _KeyType, __name: str) -> Tuple[Any, int]: ...
def SaveKey(__key: _KeyType, __file_name: str) -> None: ...
def SetValue(__key: _KeyType, __sub_key: str, __type: int, __value: str) -> None: ...
def SetValueEx(
__key: _KeyType, __value_name: str | None, __reserved: Any, __type: int, __value: str | int
) -> None: ... # reserved is ignored
def DisableReflectionKey(__key: _KeyType) -> None: ...
def EnableReflectionKey(__key: _KeyType) -> None: ...
def QueryReflectionKey(__key: _KeyType) -> bool: ...
HKEY_CLASSES_ROOT: int
HKEY_CURRENT_USER: int
HKEY_LOCAL_MACHINE: int
HKEY_USERS: int
HKEY_PERFORMANCE_DATA: int
HKEY_CURRENT_CONFIG: int
HKEY_DYN_DATA: int
def CloseKey(__hkey: _KeyType) -> None: ...
def ConnectRegistry(__computer_name: str | None, __key: _KeyType) -> HKEYType: ...
def CreateKey(__key: _KeyType, __sub_key: str | None) -> HKEYType: ...
def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = ..., access: int = ...) -> HKEYType: ...
def DeleteKey(__key: _KeyType, __sub_key: str) -> None: ...
def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ...
def DeleteValue(__key: _KeyType, __value: str) -> None: ...
def EnumKey(__key: _KeyType, __index: int) -> str: ...
def EnumValue(__key: _KeyType, __index: int) -> Tuple[str, Any, int]: ...
def ExpandEnvironmentStrings(__str: str) -> str: ...
def FlushKey(__key: _KeyType) -> None: ...
def LoadKey(__key: _KeyType, __sub_key: str, __file_name: str) -> None: ...
def OpenKey(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ...
def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ...
def QueryInfoKey(__key: _KeyType) -> Tuple[int, int, int]: ...
def QueryValue(__key: _KeyType, __sub_key: str | None) -> str: ...
def QueryValueEx(__key: _KeyType, __name: str) -> Tuple[Any, int]: ...
def SaveKey(__key: _KeyType, __file_name: str) -> None: ...
def SetValue(__key: _KeyType, __sub_key: str, __type: int, __value: str) -> None: ...
def SetValueEx(
__key: _KeyType, __value_name: str | None, __reserved: Any, __type: int, __value: str | int
) -> None: ... # reserved is ignored
def DisableReflectionKey(__key: _KeyType) -> None: ...
def EnableReflectionKey(__key: _KeyType) -> None: ...
def QueryReflectionKey(__key: _KeyType) -> bool: ...
KEY_ALL_ACCESS: int
KEY_WRITE: int
KEY_READ: int
KEY_EXECUTE: int
KEY_QUERY_VALUE: int
KEY_SET_VALUE: int
KEY_CREATE_SUB_KEY: int
KEY_ENUMERATE_SUB_KEYS: int
KEY_NOTIFY: int
KEY_CREATE_LINK: int
HKEY_CLASSES_ROOT: int
HKEY_CURRENT_USER: int
HKEY_LOCAL_MACHINE: int
HKEY_USERS: int
HKEY_PERFORMANCE_DATA: int
HKEY_CURRENT_CONFIG: int
HKEY_DYN_DATA: int
KEY_WOW64_64KEY: int
KEY_WOW64_32KEY: int
KEY_ALL_ACCESS: int
KEY_WRITE: int
KEY_READ: int
KEY_EXECUTE: int
KEY_QUERY_VALUE: int
KEY_SET_VALUE: int
KEY_CREATE_SUB_KEY: int
KEY_ENUMERATE_SUB_KEYS: int
KEY_NOTIFY: int
KEY_CREATE_LINK: int
REG_BINARY: int
REG_DWORD: int
REG_DWORD_LITTLE_ENDIAN: int
REG_DWORD_BIG_ENDIAN: int
REG_EXPAND_SZ: int
REG_LINK: int
REG_MULTI_SZ: int
REG_NONE: int
REG_RESOURCE_LIST: int
REG_FULL_RESOURCE_DESCRIPTOR: int
REG_RESOURCE_REQUIREMENTS_LIST: int
REG_SZ: int
KEY_WOW64_64KEY: int
KEY_WOW64_32KEY: int
REG_CREATED_NEW_KEY: int # undocumented
REG_LEGAL_CHANGE_FILTER: int # undocumented
REG_LEGAL_OPTION: int # undocumented
REG_NOTIFY_CHANGE_ATTRIBUTES: int # undocumented
REG_NOTIFY_CHANGE_LAST_SET: int # undocumented
REG_NOTIFY_CHANGE_NAME: int # undocumented
REG_NOTIFY_CHANGE_SECURITY: int # undocumented
REG_NO_LAZY_FLUSH: int # undocumented
REG_OPENED_EXISTING_KEY: int # undocumented
REG_OPTION_BACKUP_RESTORE: int # undocumented
REG_OPTION_CREATE_LINK: int # undocumented
REG_OPTION_NON_VOLATILE: int # undocumented
REG_OPTION_OPEN_LINK: int # undocumented
REG_OPTION_RESERVED: int # undocumented
REG_OPTION_VOLATILE: int # undocumented
REG_REFRESH_HIVE: int # undocumented
REG_WHOLE_HIVE_VOLATILE: int # undocumented
REG_BINARY: int
REG_DWORD: int
REG_DWORD_LITTLE_ENDIAN: int
REG_DWORD_BIG_ENDIAN: int
REG_EXPAND_SZ: int
REG_LINK: int
REG_MULTI_SZ: int
REG_NONE: int
REG_RESOURCE_LIST: int
REG_FULL_RESOURCE_DESCRIPTOR: int
REG_RESOURCE_REQUIREMENTS_LIST: int
REG_SZ: int
error = OSError
REG_CREATED_NEW_KEY: int # undocumented
REG_LEGAL_CHANGE_FILTER: int # undocumented
REG_LEGAL_OPTION: int # undocumented
REG_NOTIFY_CHANGE_ATTRIBUTES: int # undocumented
REG_NOTIFY_CHANGE_LAST_SET: int # undocumented
REG_NOTIFY_CHANGE_NAME: int # undocumented
REG_NOTIFY_CHANGE_SECURITY: int # undocumented
REG_NO_LAZY_FLUSH: int # undocumented
REG_OPENED_EXISTING_KEY: int # undocumented
REG_OPTION_BACKUP_RESTORE: int # undocumented
REG_OPTION_CREATE_LINK: int # undocumented
REG_OPTION_NON_VOLATILE: int # undocumented
REG_OPTION_OPEN_LINK: int # undocumented
REG_OPTION_RESERVED: int # undocumented
REG_OPTION_VOLATILE: int # undocumented
REG_REFRESH_HIVE: int # undocumented
REG_WHOLE_HIVE_VOLATILE: int # undocumented
error = OSError
# Though this class has a __name__ of PyHKEY, it's exposed as HKEYType for some reason
class HKEYType:
def __bool__(self) -> bool: ...
def __int__(self) -> int: ...
def __enter__(self) -> HKEYType: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> bool | None: ...
def Close(self) -> None: ...
def Detach(self) -> int: ...
# Though this class has a __name__ of PyHKEY, it's exposed as HKEYType for some reason
class HKEYType:
def __bool__(self) -> bool: ...
def __int__(self) -> int: ...
def __enter__(self) -> HKEYType: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> bool | None: ...
def Close(self) -> None: ...
def Detach(self) -> int: ...

View File

@@ -1 +1,4 @@
def crypt(word: str, salt: str) -> str: ...
import sys
if sys.platform != "win32":
def crypt(word: str, salt: str) -> str: ...

View File

@@ -1,82 +1,83 @@
import sys
from _typeshed import FileDescriptorLike
from typing import Any
FASYNC: int
FD_CLOEXEC: int
if sys.platform != "win32":
FASYNC: int
FD_CLOEXEC: int
DN_ACCESS: int
DN_ATTRIB: int
DN_CREATE: int
DN_DELETE: int
DN_MODIFY: int
DN_MULTISHOT: int
DN_RENAME: int
F_DUPFD: int
F_EXLCK: int
F_GETFD: int
F_GETFL: int
F_GETLEASE: int
F_GETLK: int
F_GETLK64: int
F_GETOWN: int
F_GETSIG: int
F_NOTIFY: int
F_RDLCK: int
F_SETFD: int
F_SETFL: int
F_SETLEASE: int
F_SETLK: int
F_SETLK64: int
F_SETLKW: int
F_SETLKW64: int
F_SETOWN: int
F_SETSIG: int
F_SHLCK: int
F_UNLCK: int
F_WRLCK: int
I_ATMARK: int
I_CANPUT: int
I_CKBAND: int
I_FDINSERT: int
I_FIND: int
I_FLUSH: int
I_FLUSHBAND: int
I_GETBAND: int
I_GETCLTIME: int
I_GETSIG: int
I_GRDOPT: int
I_GWROPT: int
I_LINK: int
I_LIST: int
I_LOOK: int
I_NREAD: int
I_PEEK: int
I_PLINK: int
I_POP: int
I_PUNLINK: int
I_PUSH: int
I_RECVFD: int
I_SENDFD: int
I_SETCLTIME: int
I_SETSIG: int
I_SRDOPT: int
I_STR: int
I_SWROPT: int
I_UNLINK: int
LOCK_EX: int
LOCK_MAND: int
LOCK_NB: int
LOCK_READ: int
LOCK_RW: int
LOCK_SH: int
LOCK_UN: int
LOCK_WRITE: int
DN_ACCESS: int
DN_ATTRIB: int
DN_CREATE: int
DN_DELETE: int
DN_MODIFY: int
DN_MULTISHOT: int
DN_RENAME: int
F_DUPFD: int
F_EXLCK: int
F_GETFD: int
F_GETFL: int
F_GETLEASE: int
F_GETLK: int
F_GETLK64: int
F_GETOWN: int
F_GETSIG: int
F_NOTIFY: int
F_RDLCK: int
F_SETFD: int
F_SETFL: int
F_SETLEASE: int
F_SETLK: int
F_SETLK64: int
F_SETLKW: int
F_SETLKW64: int
F_SETOWN: int
F_SETSIG: int
F_SHLCK: int
F_UNLCK: int
F_WRLCK: int
I_ATMARK: int
I_CANPUT: int
I_CKBAND: int
I_FDINSERT: int
I_FIND: int
I_FLUSH: int
I_FLUSHBAND: int
I_GETBAND: int
I_GETCLTIME: int
I_GETSIG: int
I_GRDOPT: int
I_GWROPT: int
I_LINK: int
I_LIST: int
I_LOOK: int
I_NREAD: int
I_PEEK: int
I_PLINK: int
I_POP: int
I_PUNLINK: int
I_PUSH: int
I_RECVFD: int
I_SENDFD: int
I_SETCLTIME: int
I_SETSIG: int
I_SRDOPT: int
I_STR: int
I_SWROPT: int
I_UNLINK: int
LOCK_EX: int
LOCK_MAND: int
LOCK_NB: int
LOCK_READ: int
LOCK_RW: int
LOCK_SH: int
LOCK_UN: int
LOCK_WRITE: int
# TODO All these return either int or bytes depending on the value of
# cmd (not on the type of arg).
def fcntl(fd: FileDescriptorLike, op: int, arg: int | bytes = ...) -> Any: ...
# TODO: arg: int or read-only buffer interface or read-write buffer interface
def ioctl(fd: FileDescriptorLike, op: int, arg: int | bytes = ..., mutate_flag: bool = ...) -> Any: ...
def flock(fd: FileDescriptorLike, op: int) -> None: ...
def lockf(fd: FileDescriptorLike, op: int, length: int = ..., start: int = ..., whence: int = ...) -> Any: ...
# TODO All these return either int or bytes depending on the value of
# cmd (not on the type of arg).
def fcntl(fd: FileDescriptorLike, op: int, arg: int | bytes = ...) -> Any: ...
# TODO: arg: int or read-only buffer interface or read-write buffer interface
def ioctl(fd: FileDescriptorLike, op: int, arg: int | bytes = ..., mutate_flag: bool = ...) -> Any: ...
def flock(fd: FileDescriptorLike, op: int) -> None: ...
def lockf(fd: FileDescriptorLike, op: int, length: int = ..., start: int = ..., whence: int = ...) -> Any: ...

View File

@@ -1,11 +1,12 @@
import sys
from typing import List, NamedTuple
class struct_group(NamedTuple):
gr_name: str
gr_passwd: str | None
gr_gid: int
gr_mem: List[str]
def getgrall() -> List[struct_group]: ...
def getgrgid(id: int) -> struct_group: ...
def getgrnam(name: str) -> struct_group: ...
if sys.platform != "win32":
class struct_group(NamedTuple):
gr_name: str
gr_passwd: str | None
gr_gid: int
gr_mem: List[str]
def getgrall() -> List[struct_group]: ...
def getgrgid(id: int) -> struct_group: ...
def getgrnam(name: str) -> struct_group: ...

View File

@@ -1,15 +1,16 @@
import sys
from typing import Callable, Iterable, Tuple
_Reader = Callable[[int], bytes]
if sys.platform != "win32":
_Reader = Callable[[int], bytes]
STDIN_FILENO: int
STDOUT_FILENO: int
STDERR_FILENO: int
STDIN_FILENO: int
STDOUT_FILENO: int
STDERR_FILENO: int
CHILD: int
def openpty() -> Tuple[int, int]: ...
def master_open() -> Tuple[int, str]: ...
def slave_open(tty_name: str) -> int: ...
def fork() -> Tuple[int, int]: ...
def spawn(argv: str | Iterable[str], master_read: _Reader = ..., stdin_read: _Reader = ...) -> None: ...
CHILD: int
def openpty() -> Tuple[int, int]: ...
def master_open() -> Tuple[int, str]: ...
def slave_open(tty_name: str) -> int: ...
def fork() -> Tuple[int, int]: ...
def spawn(argv: str | Iterable[str], master_read: _Reader = ..., stdin_read: _Reader = ...) -> None: ...

View File

@@ -1,14 +1,15 @@
import sys
from typing import List, Tuple
class struct_passwd(Tuple[str, str, int, int, str, str, str]):
pw_name: str
pw_passwd: str
pw_uid: int
pw_gid: int
pw_gecos: str
pw_dir: str
pw_shell: str
def getpwall() -> List[struct_passwd]: ...
def getpwuid(__uid: int) -> struct_passwd: ...
def getpwnam(__name: str) -> struct_passwd: ...
if sys.platform != "win32":
class struct_passwd(Tuple[str, str, int, int, str, str, str]):
pw_name: str
pw_passwd: str
pw_uid: int
pw_gid: int
pw_gecos: str
pw_dir: str
pw_shell: str
def getpwall() -> List[struct_passwd]: ...
def getpwuid(__uid: int) -> struct_passwd: ...
def getpwnam(__name: str) -> struct_passwd: ...

View File

@@ -1,30 +1,31 @@
import sys
from typing import Callable, Optional, Sequence, Text
_CompleterT = Optional[Callable[[str, int], Optional[str]]]
_CompDispT = Optional[Callable[[str, Sequence[str], int], None]]
def parse_and_bind(__string: str) -> None: ...
def read_init_file(__filename: Text | None = ...) -> None: ...
def get_line_buffer() -> str: ...
def insert_text(__string: str) -> None: ...
def redisplay() -> None: ...
def read_history_file(__filename: Text | None = ...) -> None: ...
def write_history_file(__filename: Text | None = ...) -> None: ...
def get_history_length() -> int: ...
def set_history_length(__length: int) -> None: ...
def clear_history() -> None: ...
def get_current_history_length() -> int: ...
def get_history_item(__index: int) -> str: ...
def remove_history_item(__pos: int) -> None: ...
def replace_history_item(__pos: int, __line: str) -> None: ...
def add_history(__string: str) -> None: ...
def set_startup_hook(__function: Callable[[], None] | None = ...) -> None: ...
def set_pre_input_hook(__function: Callable[[], None] | None = ...) -> None: ...
def set_completer(__function: _CompleterT = ...) -> None: ...
def get_completer() -> _CompleterT: ...
def get_completion_type() -> int: ...
def get_begidx() -> int: ...
def get_endidx() -> int: ...
def set_completer_delims(__string: str) -> None: ...
def get_completer_delims() -> str: ...
def set_completion_display_matches_hook(__function: _CompDispT = ...) -> None: ...
if sys.platform != "win32":
_CompleterT = Optional[Callable[[str, int], Optional[str]]]
_CompDispT = Optional[Callable[[str, Sequence[str], int], None]]
def parse_and_bind(__string: str) -> None: ...
def read_init_file(__filename: Text | None = ...) -> None: ...
def get_line_buffer() -> str: ...
def insert_text(__string: str) -> None: ...
def redisplay() -> None: ...
def read_history_file(__filename: Text | None = ...) -> None: ...
def write_history_file(__filename: Text | None = ...) -> None: ...
def get_history_length() -> int: ...
def set_history_length(__length: int) -> None: ...
def clear_history() -> None: ...
def get_current_history_length() -> int: ...
def get_history_item(__index: int) -> str: ...
def remove_history_item(__pos: int) -> None: ...
def replace_history_item(__pos: int, __line: str) -> None: ...
def add_history(__string: str) -> None: ...
def set_startup_hook(__function: Callable[[], None] | None = ...) -> None: ...
def set_pre_input_hook(__function: Callable[[], None] | None = ...) -> None: ...
def set_completer(__function: _CompleterT = ...) -> None: ...
def get_completer() -> _CompleterT: ...
def get_completion_type() -> int: ...
def get_begidx() -> int: ...
def get_endidx() -> int: ...
def set_completer_delims(__string: str) -> None: ...
def get_completer_delims() -> str: ...
def set_completion_display_matches_hook(__function: _CompDispT = ...) -> None: ...

View File

@@ -1,46 +1,42 @@
import sys
from typing import NamedTuple, Tuple
class error(Exception): ...
RLIM_INFINITY: int
def getrlimit(resource: int) -> Tuple[int, int]: ...
def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ...
RLIMIT_CORE: int
RLIMIT_CPU: int
RLIMIT_FSIZE: int
RLIMIT_DATA: int
RLIMIT_STACK: int
RLIMIT_RSS: int
RLIMIT_NPROC: int
RLIMIT_NOFILE: int
RLIMIT_OFILE: int
RLIMIT_MEMLOCK: int
RLIMIT_VMEM: int
RLIMIT_AS: int
class _RUsage(NamedTuple):
ru_utime: float
ru_stime: float
ru_maxrss: int
ru_ixrss: int
ru_idrss: int
ru_isrss: int
ru_minflt: int
ru_majflt: int
ru_nswap: int
ru_inblock: int
ru_oublock: int
ru_msgsnd: int
ru_msgrcv: int
ru_nsignals: int
ru_nvcsw: int
ru_nivcsw: int
def getrusage(who: int) -> _RUsage: ...
def getpagesize() -> int: ...
RUSAGE_SELF: int
RUSAGE_CHILDREN: int
RUSAGE_BOTH: int
if sys.platform != "win32":
class error(Exception): ...
RLIM_INFINITY: int
def getrlimit(resource: int) -> Tuple[int, int]: ...
def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ...
RLIMIT_CORE: int
RLIMIT_CPU: int
RLIMIT_FSIZE: int
RLIMIT_DATA: int
RLIMIT_STACK: int
RLIMIT_RSS: int
RLIMIT_NPROC: int
RLIMIT_NOFILE: int
RLIMIT_OFILE: int
RLIMIT_MEMLOCK: int
RLIMIT_VMEM: int
RLIMIT_AS: int
class _RUsage(NamedTuple):
ru_utime: float
ru_stime: float
ru_maxrss: int
ru_ixrss: int
ru_idrss: int
ru_isrss: int
ru_minflt: int
ru_majflt: int
ru_nswap: int
ru_inblock: int
ru_oublock: int
ru_msgsnd: int
ru_msgrcv: int
ru_nsignals: int
ru_nvcsw: int
ru_nivcsw: int
def getrusage(who: int) -> _RUsage: ...
def getpagesize() -> int: ...
RUSAGE_SELF: int
RUSAGE_CHILDREN: int
RUSAGE_BOTH: int

View File

@@ -1,15 +1,16 @@
import sys
from typing import List, NamedTuple
class struct_spwd(NamedTuple):
sp_nam: str
sp_pwd: str
sp_lstchg: int
sp_min: int
sp_max: int
sp_warn: int
sp_inact: int
sp_expire: int
sp_flag: int
def getspall() -> List[struct_spwd]: ...
def getspnam(name: str) -> struct_spwd: ...
if sys.platform != "win32":
class struct_spwd(NamedTuple):
sp_nam: str
sp_pwd: str
sp_lstchg: int
sp_min: int
sp_max: int
sp_warn: int
sp_inact: int
sp_expire: int
sp_flag: int
def getspall() -> List[struct_spwd]: ...
def getspnam(name: str) -> struct_spwd: ...

View File

@@ -1,43 +1,44 @@
import sys
from typing import overload
LOG_ALERT: int
LOG_AUTH: int
LOG_CONS: int
LOG_CRIT: int
LOG_CRON: int
LOG_DAEMON: int
LOG_DEBUG: int
LOG_EMERG: int
LOG_ERR: int
LOG_INFO: int
LOG_KERN: int
LOG_LOCAL0: int
LOG_LOCAL1: int
LOG_LOCAL2: int
LOG_LOCAL3: int
LOG_LOCAL4: int
LOG_LOCAL5: int
LOG_LOCAL6: int
LOG_LOCAL7: int
LOG_LPR: int
LOG_MAIL: int
LOG_NDELAY: int
LOG_NEWS: int
LOG_NOTICE: int
LOG_NOWAIT: int
LOG_PERROR: int
LOG_PID: int
LOG_SYSLOG: int
LOG_USER: int
LOG_UUCP: int
LOG_WARNING: int
def LOG_MASK(a: int) -> int: ...
def LOG_UPTO(a: int) -> int: ...
def closelog() -> None: ...
def openlog(ident: str = ..., logoption: int = ..., facility: int = ...) -> None: ...
def setlogmask(x: int) -> int: ...
@overload
def syslog(priority: int, message: str) -> None: ...
@overload
def syslog(message: str) -> None: ...
if sys.platform != "win32":
LOG_ALERT: int
LOG_AUTH: int
LOG_CONS: int
LOG_CRIT: int
LOG_CRON: int
LOG_DAEMON: int
LOG_DEBUG: int
LOG_EMERG: int
LOG_ERR: int
LOG_INFO: int
LOG_KERN: int
LOG_LOCAL0: int
LOG_LOCAL1: int
LOG_LOCAL2: int
LOG_LOCAL3: int
LOG_LOCAL4: int
LOG_LOCAL5: int
LOG_LOCAL6: int
LOG_LOCAL7: int
LOG_LPR: int
LOG_MAIL: int
LOG_NDELAY: int
LOG_NEWS: int
LOG_NOTICE: int
LOG_NOWAIT: int
LOG_PERROR: int
LOG_PID: int
LOG_SYSLOG: int
LOG_USER: int
LOG_UUCP: int
LOG_WARNING: int
def LOG_MASK(a: int) -> int: ...
def LOG_UPTO(a: int) -> int: ...
def closelog() -> None: ...
def openlog(ident: str = ..., logoption: int = ..., facility: int = ...) -> None: ...
def setlogmask(x: int) -> int: ...
@overload
def syslog(priority: int, message: str) -> None: ...
@overload
def syslog(message: str) -> None: ...

View File

@@ -1,246 +1,246 @@
import sys
from _typeshed import FileDescriptorLike
from typing import Any, List, Union
_Attr = List[Union[int, List[Union[bytes, int]]]]
if sys.platform != "win32":
_Attr = List[Union[int, List[Union[bytes, int]]]]
# TODO constants not really documented
B0: int
B1000000: int
B110: int
B115200: int
B1152000: int
B1200: int
B134: int
B150: int
B1500000: int
B1800: int
B19200: int
B200: int
B2000000: int
B230400: int
B2400: int
B2500000: int
B300: int
B3000000: int
B3500000: int
B38400: int
B4000000: int
B460800: int
B4800: int
B50: int
B500000: int
B57600: int
B576000: int
B600: int
B75: int
B921600: int
B9600: int
BRKINT: int
BS0: int
BS1: int
BSDLY: int
CBAUD: int
CBAUDEX: int
CDSUSP: int
CEOF: int
CEOL: int
CEOT: int
CERASE: int
CFLUSH: int
CIBAUD: int
CINTR: int
CKILL: int
CLNEXT: int
CLOCAL: int
CQUIT: int
CR0: int
CR1: int
CR2: int
CR3: int
CRDLY: int
CREAD: int
CRPRNT: int
CRTSCTS: int
CS5: int
CS6: int
CS7: int
CS8: int
CSIZE: int
CSTART: int
CSTOP: int
CSTOPB: int
CSUSP: int
CWERASE: int
ECHO: int
ECHOCTL: int
ECHOE: int
ECHOK: int
ECHOKE: int
ECHONL: int
ECHOPRT: int
EXTA: int
EXTB: int
FF0: int
FF1: int
FFDLY: int
FIOASYNC: int
FIOCLEX: int
FIONBIO: int
FIONCLEX: int
FIONREAD: int
FLUSHO: int
HUPCL: int
ICANON: int
ICRNL: int
IEXTEN: int
IGNBRK: int
IGNCR: int
IGNPAR: int
IMAXBEL: int
INLCR: int
INPCK: int
IOCSIZE_MASK: int
IOCSIZE_SHIFT: int
ISIG: int
ISTRIP: int
IUCLC: int
IXANY: int
IXOFF: int
IXON: int
NCC: int
NCCS: int
NL0: int
NL1: int
NLDLY: int
NOFLSH: int
N_MOUSE: int
N_PPP: int
N_SLIP: int
N_STRIP: int
N_TTY: int
OCRNL: int
OFDEL: int
OFILL: int
OLCUC: int
ONLCR: int
ONLRET: int
ONOCR: int
OPOST: int
PARENB: int
PARMRK: int
PARODD: int
PENDIN: int
TAB0: int
TAB1: int
TAB2: int
TAB3: int
TABDLY: int
TCFLSH: int
TCGETA: int
TCGETS: int
TCIFLUSH: int
TCIOFF: int
TCIOFLUSH: int
TCION: int
TCOFLUSH: int
TCOOFF: int
TCOON: int
TCSADRAIN: int
TCSAFLUSH: int
TCSANOW: int
TCSBRK: int
TCSBRKP: int
TCSETA: int
TCSETAF: int
TCSETAW: int
TCSETS: int
TCSETSF: int
TCSETSW: int
TCXONC: int
TIOCCONS: int
TIOCEXCL: int
TIOCGETD: int
TIOCGICOUNT: int
TIOCGLCKTRMIOS: int
TIOCGPGRP: int
TIOCGSERIAL: int
TIOCGSOFTCAR: int
TIOCGWINSZ: int
TIOCINQ: int
TIOCLINUX: int
TIOCMBIC: int
TIOCMBIS: int
TIOCMGET: int
TIOCMIWAIT: int
TIOCMSET: int
TIOCM_CAR: int
TIOCM_CD: int
TIOCM_CTS: int
TIOCM_DSR: int
TIOCM_DTR: int
TIOCM_LE: int
TIOCM_RI: int
TIOCM_RNG: int
TIOCM_RTS: int
TIOCM_SR: int
TIOCM_ST: int
TIOCNOTTY: int
TIOCNXCL: int
TIOCOUTQ: int
TIOCPKT: int
TIOCPKT_DATA: int
TIOCPKT_DOSTOP: int
TIOCPKT_FLUSHREAD: int
TIOCPKT_FLUSHWRITE: int
TIOCPKT_NOSTOP: int
TIOCPKT_START: int
TIOCPKT_STOP: int
TIOCSCTTY: int
TIOCSERCONFIG: int
TIOCSERGETLSR: int
TIOCSERGETMULTI: int
TIOCSERGSTRUCT: int
TIOCSERGWILD: int
TIOCSERSETMULTI: int
TIOCSERSWILD: int
TIOCSER_TEMT: int
TIOCSETD: int
TIOCSLCKTRMIOS: int
TIOCSPGRP: int
TIOCSSERIAL: int
TIOCSSOFTCAR: int
TIOCSTI: int
TIOCSWINSZ: int
TOSTOP: int
VDISCARD: int
VEOF: int
VEOL: int
VEOL2: int
VERASE: int
VINTR: int
VKILL: int
VLNEXT: int
VMIN: int
VQUIT: int
VREPRINT: int
VSTART: int
VSTOP: int
VSUSP: int
VSWTC: int
VSWTCH: int
VT0: int
VT1: int
VTDLY: int
VTIME: int
VWERASE: int
XCASE: int
XTABS: int
def tcgetattr(__fd: FileDescriptorLike) -> List[Any]: ...
def tcsetattr(__fd: FileDescriptorLike, __when: int, __attributes: _Attr) -> None: ...
def tcsendbreak(__fd: FileDescriptorLike, __duration: int) -> None: ...
def tcdrain(__fd: FileDescriptorLike) -> None: ...
def tcflush(__fd: FileDescriptorLike, __queue: int) -> None: ...
def tcflow(__fd: FileDescriptorLike, __action: int) -> None: ...
class error(Exception): ...
# TODO constants not really documented
B0: int
B1000000: int
B110: int
B115200: int
B1152000: int
B1200: int
B134: int
B150: int
B1500000: int
B1800: int
B19200: int
B200: int
B2000000: int
B230400: int
B2400: int
B2500000: int
B300: int
B3000000: int
B3500000: int
B38400: int
B4000000: int
B460800: int
B4800: int
B50: int
B500000: int
B57600: int
B576000: int
B600: int
B75: int
B921600: int
B9600: int
BRKINT: int
BS0: int
BS1: int
BSDLY: int
CBAUD: int
CBAUDEX: int
CDSUSP: int
CEOF: int
CEOL: int
CEOT: int
CERASE: int
CFLUSH: int
CIBAUD: int
CINTR: int
CKILL: int
CLNEXT: int
CLOCAL: int
CQUIT: int
CR0: int
CR1: int
CR2: int
CR3: int
CRDLY: int
CREAD: int
CRPRNT: int
CRTSCTS: int
CS5: int
CS6: int
CS7: int
CS8: int
CSIZE: int
CSTART: int
CSTOP: int
CSTOPB: int
CSUSP: int
CWERASE: int
ECHO: int
ECHOCTL: int
ECHOE: int
ECHOK: int
ECHOKE: int
ECHONL: int
ECHOPRT: int
EXTA: int
EXTB: int
FF0: int
FF1: int
FFDLY: int
FIOASYNC: int
FIOCLEX: int
FIONBIO: int
FIONCLEX: int
FIONREAD: int
FLUSHO: int
HUPCL: int
ICANON: int
ICRNL: int
IEXTEN: int
IGNBRK: int
IGNCR: int
IGNPAR: int
IMAXBEL: int
INLCR: int
INPCK: int
IOCSIZE_MASK: int
IOCSIZE_SHIFT: int
ISIG: int
ISTRIP: int
IUCLC: int
IXANY: int
IXOFF: int
IXON: int
NCC: int
NCCS: int
NL0: int
NL1: int
NLDLY: int
NOFLSH: int
N_MOUSE: int
N_PPP: int
N_SLIP: int
N_STRIP: int
N_TTY: int
OCRNL: int
OFDEL: int
OFILL: int
OLCUC: int
ONLCR: int
ONLRET: int
ONOCR: int
OPOST: int
PARENB: int
PARMRK: int
PARODD: int
PENDIN: int
TAB0: int
TAB1: int
TAB2: int
TAB3: int
TABDLY: int
TCFLSH: int
TCGETA: int
TCGETS: int
TCIFLUSH: int
TCIOFF: int
TCIOFLUSH: int
TCION: int
TCOFLUSH: int
TCOOFF: int
TCOON: int
TCSADRAIN: int
TCSAFLUSH: int
TCSANOW: int
TCSBRK: int
TCSBRKP: int
TCSETA: int
TCSETAF: int
TCSETAW: int
TCSETS: int
TCSETSF: int
TCSETSW: int
TCXONC: int
TIOCCONS: int
TIOCEXCL: int
TIOCGETD: int
TIOCGICOUNT: int
TIOCGLCKTRMIOS: int
TIOCGPGRP: int
TIOCGSERIAL: int
TIOCGSOFTCAR: int
TIOCGWINSZ: int
TIOCINQ: int
TIOCLINUX: int
TIOCMBIC: int
TIOCMBIS: int
TIOCMGET: int
TIOCMIWAIT: int
TIOCMSET: int
TIOCM_CAR: int
TIOCM_CD: int
TIOCM_CTS: int
TIOCM_DSR: int
TIOCM_DTR: int
TIOCM_LE: int
TIOCM_RI: int
TIOCM_RNG: int
TIOCM_RTS: int
TIOCM_SR: int
TIOCM_ST: int
TIOCNOTTY: int
TIOCNXCL: int
TIOCOUTQ: int
TIOCPKT: int
TIOCPKT_DATA: int
TIOCPKT_DOSTOP: int
TIOCPKT_FLUSHREAD: int
TIOCPKT_FLUSHWRITE: int
TIOCPKT_NOSTOP: int
TIOCPKT_START: int
TIOCPKT_STOP: int
TIOCSCTTY: int
TIOCSERCONFIG: int
TIOCSERGETLSR: int
TIOCSERGETMULTI: int
TIOCSERGSTRUCT: int
TIOCSERGWILD: int
TIOCSERSETMULTI: int
TIOCSERSWILD: int
TIOCSER_TEMT: int
TIOCSETD: int
TIOCSLCKTRMIOS: int
TIOCSPGRP: int
TIOCSSERIAL: int
TIOCSSOFTCAR: int
TIOCSTI: int
TIOCSWINSZ: int
TOSTOP: int
VDISCARD: int
VEOF: int
VEOL: int
VEOL2: int
VERASE: int
VINTR: int
VKILL: int
VLNEXT: int
VMIN: int
VQUIT: int
VREPRINT: int
VSTART: int
VSTOP: int
VSUSP: int
VSWTC: int
VSWTCH: int
VT0: int
VT1: int
VTDLY: int
VTIME: int
VWERASE: int
XCASE: int
XTABS: int
def tcgetattr(__fd: FileDescriptorLike) -> List[Any]: ...
def tcsetattr(__fd: FileDescriptorLike, __when: int, __attributes: _Attr) -> None: ...
def tcsendbreak(__fd: FileDescriptorLike, __duration: int) -> None: ...
def tcdrain(__fd: FileDescriptorLike) -> None: ...
def tcflush(__fd: FileDescriptorLike, __queue: int) -> None: ...
def tcflow(__fd: FileDescriptorLike, __action: int) -> None: ...
class error(Exception): ...

View File

@@ -1,15 +1,16 @@
import sys
from typing import IO, Union
_FD = Union[int, IO[str]]
# XXX: Undocumented integer constants
IFLAG: int
OFLAG: int
CFLAG: int
LFLAG: int
ISPEED: int
OSPEED: int
CC: int
def setraw(fd: _FD, when: int = ...) -> None: ...
def setcbreak(fd: _FD, when: int = ...) -> None: ...
if sys.platform != "win32":
# XXX: Undocumented integer constants
IFLAG: int
OFLAG: int
CFLAG: int
LFLAG: int
ISPEED: int
OSPEED: int
CC: int
def setraw(fd: _FD, when: int = ...) -> None: ...
def setcbreak(fd: _FD, when: int = ...) -> None: ...