mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
refactoring
This commit is contained in:
@@ -185,7 +185,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
|
||||
"unlock_cmd": Option([*sudo, "/usr/bin/kvmd-helper-otgmsd-unlock", "unlock"], type=valid_command),
|
||||
|
||||
"initial": {
|
||||
"image": Option("", type=(lambda arg: (valid_printable_filename(arg) if arg else ""))),
|
||||
"image": Option("", type=valid_printable_filename, if_empty=""),
|
||||
"cdrom": Option(False, type=valid_bool),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
|
||||
import socket
|
||||
import functools
|
||||
|
||||
from typing import Dict
|
||||
from typing import Optional
|
||||
@@ -60,9 +61,9 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute
|
||||
@classmethod
|
||||
def get_plugin_options(cls) -> Dict:
|
||||
return {
|
||||
"ip": Option("255.255.255.255", type=(lambda arg: valid_ip(arg, v6=False))),
|
||||
"ip": Option("255.255.255.255", type=functools.partial(valid_ip, v6=False)),
|
||||
"port": Option(9, type=valid_port),
|
||||
"mac": Option("", type=(lambda arg: (valid_mac(arg) if arg else ""))),
|
||||
"mac": Option("", type=valid_mac, if_empty=""),
|
||||
}
|
||||
|
||||
def register_input(self, pin: int, debounce: float) -> None:
|
||||
|
||||
Reference in New Issue
Block a user