diff options
author | Maxim Devaev <[email protected]> | 2022-09-04 18:08:40 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-09-04 18:08:40 +0300 |
commit | ee3e224e396494cd0d69bb6167087a071a20349c (patch) | |
tree | 5becd28570e58a03c6e1e231d0db24c264a73f88 /kvmd/validators/ugpio.py | |
parent | 4b75221e9470b4a009955d7677f16adf8e23e302 (diff) |
new typing style
Diffstat (limited to 'kvmd/validators/ugpio.py')
-rw-r--r-- | kvmd/validators/ugpio.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kvmd/validators/ugpio.py b/kvmd/validators/ugpio.py index 6f32a26f..c05aa75d 100644 --- a/kvmd/validators/ugpio.py +++ b/kvmd/validators/ugpio.py @@ -20,9 +20,6 @@ # ========================================================================== # -from typing import List -from typing import Set -from typing import Optional from typing import Any from . import raise_error @@ -32,7 +29,7 @@ from . import check_len # ===== -def valid_ugpio_driver(arg: Any, variants: Optional[Set[str]]=None) -> str: +def valid_ugpio_driver(arg: Any, variants: (set[str] | None)=None) -> str: name = "GPIO driver" arg = check_len(check_re_match(arg, name, r"^[a-zA-Z_][a-zA-Z0-9_-]*$"), name, 255) if variants is not None: @@ -45,11 +42,11 @@ def valid_ugpio_channel(arg: Any) -> str: return check_len(check_re_match(arg, name, r"^[a-zA-Z_][a-zA-Z0-9_.-]*$"), name, 255) -def valid_ugpio_mode(arg: Any, variants: Set[str]) -> str: +def valid_ugpio_mode(arg: Any, variants: set[str]) -> str: return check_string_in_list(arg, "GPIO driver's pin mode", variants) -def valid_ugpio_view_table(arg: Any) -> List[List[str]]: # pylint: disable=inconsistent-return-statements +def valid_ugpio_view_table(arg: Any) -> list[list[str]]: # pylint: disable=inconsistent-return-statements try: return [list(map(str, row)) for row in list(arg)] except Exception: |