diff options
author | HampusM <hampus@hampusmat.com> | 2022-02-14 09:53:28 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-02-14 10:05:53 +0100 |
commit | a8049bb66f7bc62c9a33488615d0990e0a920520 (patch) | |
tree | 1372e18896897490650203efe72c8244a23204cf /typings/serial/tools | |
parent | 336d968dd2a4473b3acd71cfef86ad47a7901fbc (diff) |
build: add utility scripts
Diffstat (limited to 'typings/serial/tools')
-rw-r--r-- | typings/serial/tools/list_ports.pyi | 16 | ||||
-rw-r--r-- | typings/serial/tools/list_ports_common.pyi | 16 | ||||
-rw-r--r-- | typings/serial/tools/list_ports_linux.pyi | 11 | ||||
-rw-r--r-- | typings/serial/tools/list_ports_windows.pyi | 8 |
4 files changed, 51 insertions, 0 deletions
diff --git a/typings/serial/tools/list_ports.pyi b/typings/serial/tools/list_ports.pyi new file mode 100644 index 0000000..67df6f6 --- /dev/null +++ b/typings/serial/tools/list_ports.pyi @@ -0,0 +1,16 @@ +"""\ +This module will provide a function called comports that returns an +iterable (generator or list) that will enumerate available com ports. Note that +on some systems non-existent ports may be listed. + +Additionally a grep function is supplied that can be used to search for ports +based on their descriptions or hardware ID. +""" +from typing import Any, List, Optional + +from list_ports_common import ListPortInfo + + +def comports(include_links: Optional[Any] = ...) -> List[ListPortInfo]: + """Return a list of info objects about serial ports""" + ... diff --git a/typings/serial/tools/list_ports_common.pyi b/typings/serial/tools/list_ports_common.pyi new file mode 100644 index 0000000..60920d0 --- /dev/null +++ b/typings/serial/tools/list_ports_common.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + + +class ListPortInfo: + """Info collection base class for serial ports""" + + def __init__( + self, + device: Any, + skip_link_detection: Optional[Any] = ... + ) -> None: + ... + + @property + def device(self) -> str: + ... diff --git a/typings/serial/tools/list_ports_linux.pyi b/typings/serial/tools/list_ports_linux.pyi new file mode 100644 index 0000000..ccb94ed --- /dev/null +++ b/typings/serial/tools/list_ports_linux.pyi @@ -0,0 +1,11 @@ +from typing import Any, List, Optional +import serial.tools.list_ports_common + + +class SysFS(serial.tools.list_ports_common.ListPortInfo): + """Wrapper for easy sysfs access and device info""" + ... + + +def comports(include_links: Optional[Any] = ...) -> List[SysFS]: + ... diff --git a/typings/serial/tools/list_ports_windows.pyi b/typings/serial/tools/list_ports_windows.pyi new file mode 100644 index 0000000..314af5b --- /dev/null +++ b/typings/serial/tools/list_ports_windows.pyi @@ -0,0 +1,8 @@ +from typing import Any, List, Optional + +from serial.tools.list_ports_common import ListPortInfo + + +def comports(include_links: Optional[Any] = ...) -> List[ListPortInfo]: + """Return a list of info objects about serial ports""" + ... |