mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-27 20:12:21 +08:00
pyserial: fix stubtest errors (#9722)
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
import sys
|
||||
|
||||
from serial.tools.list_ports_common import ListPortInfo
|
||||
|
||||
if sys.platform == "linux":
|
||||
class SysFS(ListPortInfo):
|
||||
usb_device_path: str | None
|
||||
device_path: str | None
|
||||
subsystem: str | None
|
||||
usb_interface_path: str | None
|
||||
def __init__(self, device: str) -> None: ...
|
||||
def read_line(self, *args: str) -> str | None: ...
|
||||
class SysFS(ListPortInfo):
|
||||
usb_device_path: str | None
|
||||
device_path: str | None
|
||||
subsystem: str | None
|
||||
usb_interface_path: str | None
|
||||
def __init__(self, device: str) -> None: ...
|
||||
def read_line(self, *args: str) -> str | None: ...
|
||||
|
||||
def comports(include_links: bool = ...) -> list[SysFS]: ...
|
||||
def comports(include_links: bool = ...) -> list[SysFS]: ...
|
||||
|
||||
@@ -23,8 +23,17 @@ if sys.platform == "win32":
|
||||
ACCESS_MASK = DWORD
|
||||
REGSAM = ACCESS_MASK
|
||||
|
||||
class GUID(ctypes.Structure): ...
|
||||
class SP_DEVINFO_DATA(ctypes.Structure): ...
|
||||
class GUID(ctypes.Structure):
|
||||
Data1: ctypes._CField
|
||||
Data2: ctypes._CField
|
||||
Data3: ctypes._CField
|
||||
Data4: ctypes._CField
|
||||
|
||||
class SP_DEVINFO_DATA(ctypes.Structure):
|
||||
cbSize: ctypes._CField
|
||||
ClassGuid: ctypes._CField
|
||||
DevInst: ctypes._CField
|
||||
Reserved: ctypes._CField
|
||||
PSP_DEVINFO_DATA: type[ctypes._Pointer[SP_DEVINFO_DATA]]
|
||||
PSP_DEVICE_INTERFACE_DETAIL_DATA = ctypes.c_void_p
|
||||
setupapi: ctypes.WinDLL
|
||||
|
||||
@@ -1,28 +1,84 @@
|
||||
import sys
|
||||
from ctypes import Structure, Union, _NamedFuncPointer, _Pointer, c_int64, c_ulong, c_void_p
|
||||
from ctypes import Structure, Union, _CField, _NamedFuncPointer, _Pointer, c_int64, c_ulong, c_void_p
|
||||
from ctypes.wintypes import DWORD
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
if sys.platform == "win32":
|
||||
def is_64bit() -> bool: ...
|
||||
|
||||
ULONG_PTR: c_int64 | c_ulong
|
||||
ULONG_PTR: type[c_int64 | c_ulong]
|
||||
|
||||
class _SECURITY_ATTRIBUTES(Structure): ...
|
||||
class _SECURITY_ATTRIBUTES(Structure):
|
||||
nLength: _CField
|
||||
lpSecurityDescriptor: _CField
|
||||
bInheritHandle: _CField
|
||||
LPSECURITY_ATTRIBUTES: type[_Pointer[_SECURITY_ATTRIBUTES]]
|
||||
CreateEvent: _NamedFuncPointer
|
||||
CreateFile: _NamedFuncPointer
|
||||
# The following are included in __all__ but their existence is not guaranteed as
|
||||
# they are defined in a try/except block. Their aliases above are always defined.
|
||||
CreateEventW: _NamedFuncPointer
|
||||
CreateFileW: _NamedFuncPointer
|
||||
|
||||
class _OVERLAPPED(Structure): ...
|
||||
class _OVERLAPPED(Structure):
|
||||
Internal: _CField
|
||||
InternalHigh: _CField
|
||||
Offset: _CField
|
||||
OffsetHigh: _CField
|
||||
Pointer: _CField
|
||||
hEvent: _CField
|
||||
OVERLAPPED: TypeAlias = _OVERLAPPED
|
||||
|
||||
class _COMSTAT(Structure): ...
|
||||
class _COMSTAT(Structure):
|
||||
fCtsHold: _CField
|
||||
fDsrHold: _CField
|
||||
fRlsdHold: _CField
|
||||
fXoffHold: _CField
|
||||
fXoffSent: _CField
|
||||
fEof: _CField
|
||||
fTxim: _CField
|
||||
fReserved: _CField
|
||||
cbInQue: _CField
|
||||
cbOutQue: _CField
|
||||
COMSTAT: TypeAlias = _COMSTAT
|
||||
|
||||
class _DCB(Structure): ...
|
||||
class _DCB(Structure):
|
||||
DCBlength: _CField
|
||||
BaudRate: _CField
|
||||
fBinary: _CField
|
||||
fParity: _CField
|
||||
fOutxCtsFlow: _CField
|
||||
fOutxDsrFlow: _CField
|
||||
fDtrControl: _CField
|
||||
fDsrSensitivity: _CField
|
||||
fTXContinueOnXoff: _CField
|
||||
fOutX: _CField
|
||||
fInX: _CField
|
||||
fErrorChar: _CField
|
||||
fNull: _CField
|
||||
fRtsControl: _CField
|
||||
fAbortOnError: _CField
|
||||
fDummy2: _CField
|
||||
wReserved: _CField
|
||||
XonLim: _CField
|
||||
XoffLim: _CField
|
||||
ByteSize: _CField
|
||||
Parity: _CField
|
||||
StopBits: _CField
|
||||
XonChar: _CField
|
||||
XoffChar: _CField
|
||||
ErrorChar: _CField
|
||||
EofChar: _CField
|
||||
EvtChar: _CField
|
||||
wReserved1: _CField
|
||||
DCB: TypeAlias = _DCB
|
||||
|
||||
class _COMMTIMEOUTS(Structure): ...
|
||||
class _COMMTIMEOUTS(Structure):
|
||||
ReadIntervalTimeout: _CField
|
||||
ReadTotalTimeoutMultiplier: _CField
|
||||
ReadTotalTimeoutConstant: _CField
|
||||
WriteTotalTimeoutMultiplier: _CField
|
||||
WriteTotalTimeoutConstant: _CField
|
||||
COMMTIMEOUTS: TypeAlias = _COMMTIMEOUTS
|
||||
|
||||
GetLastError: _NamedFuncPointer
|
||||
@@ -94,6 +150,12 @@ if sys.platform == "win32":
|
||||
EV_BREAK: int
|
||||
PURGE_RXCLEAR: int
|
||||
|
||||
class N11_OVERLAPPED4DOLLAR_48E(Union): ...
|
||||
class N11_OVERLAPPED4DOLLAR_484DOLLAR_49E(Structure): ...
|
||||
class N11_OVERLAPPED4DOLLAR_48E(Union):
|
||||
Offset: _CField
|
||||
OffsetHigh: _CField
|
||||
Pointer: _CField
|
||||
|
||||
class N11_OVERLAPPED4DOLLAR_484DOLLAR_49E(Structure):
|
||||
Offset: _CField
|
||||
OffsetHigh: _CField
|
||||
PVOID: TypeAlias = c_void_p
|
||||
|
||||
Reference in New Issue
Block a user