mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
mypy fix
This commit is contained in:
parent
ebe1255921
commit
31c74a1c30
@ -27,8 +27,6 @@ from typing import Dict
|
||||
from typing import Type
|
||||
from typing import Any
|
||||
|
||||
from ..yamlconf import Option
|
||||
|
||||
|
||||
# =====
|
||||
class UnknownPluginError(Exception):
|
||||
@ -46,7 +44,7 @@ class BasePlugin:
|
||||
return name[name.rindex(".") + 1:]
|
||||
|
||||
@classmethod
|
||||
def get_plugin_options(cls) -> Dict[str, Option]:
|
||||
def get_plugin_options(cls) -> Dict:
|
||||
return {} # pragma: nocover
|
||||
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ class Plugin(BaseAtx): # pylint: disable=too-many-instance-attributes
|
||||
self.__region = aioregion.AioExclusiveRegion(AtxIsBusyError)
|
||||
|
||||
@classmethod
|
||||
def get_plugin_options(cls) -> Dict[str, Option]:
|
||||
def get_plugin_options(cls) -> Dict:
|
||||
return {
|
||||
"power_led_pin": Option(-1, type=valid_gpio_pin),
|
||||
"hdd_led_pin": Option(-1, type=valid_gpio_pin),
|
||||
|
||||
@ -37,7 +37,7 @@ class Plugin(BaseAuthService):
|
||||
self.__path = path
|
||||
|
||||
@classmethod
|
||||
def get_plugin_options(cls) -> Dict[str, Option]:
|
||||
def get_plugin_options(cls) -> Dict:
|
||||
return {
|
||||
"file": Option("/etc/kvmd/htpasswd", type=valid_abs_path_exists, unpack_as="path"),
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ class Plugin(BaseAuthService):
|
||||
self.__http_session: Optional[aiohttp.ClientSession] = None
|
||||
|
||||
@classmethod
|
||||
def get_plugin_options(cls) -> Dict[str, Option]:
|
||||
def get_plugin_options(cls) -> Dict:
|
||||
return {
|
||||
"url": Option("http://localhost/auth"),
|
||||
"verify": Option(True, type=valid_bool),
|
||||
|
||||
@ -55,7 +55,7 @@ class Plugin(BaseHid):
|
||||
self.__lock = asyncio.Lock()
|
||||
|
||||
@classmethod
|
||||
def get_plugin_options(cls) -> Dict[str, Option]:
|
||||
def get_plugin_options(cls) -> Dict:
|
||||
return {
|
||||
"keyboard": {
|
||||
"device": Option("", type=valid_abs_path, unpack_as="device_path"),
|
||||
|
||||
@ -167,7 +167,7 @@ class Plugin(BaseHid, multiprocessing.Process): # pylint: disable=too-many-inst
|
||||
self.__stop_event = multiprocessing.Event()
|
||||
|
||||
@classmethod
|
||||
def get_plugin_options(cls) -> Dict[str, Option]:
|
||||
def get_plugin_options(cls) -> Dict:
|
||||
return {
|
||||
"reset_pin": Option(-1, type=valid_gpio_pin),
|
||||
"reset_delay": Option(0.1, type=valid_float_f01),
|
||||
|
||||
@ -198,7 +198,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
|
||||
log("MSD is offline: %s", err)
|
||||
|
||||
@classmethod
|
||||
def get_plugin_options(cls) -> Dict[str, Option]:
|
||||
def get_plugin_options(cls) -> Dict:
|
||||
return {
|
||||
"target_pin": Option(-1, type=valid_gpio_pin),
|
||||
"reset_pin": Option(-1, type=valid_gpio_pin),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user