mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
refactoring
This commit is contained in:
@@ -129,12 +129,12 @@ class Plugin(BaseUserGpioDriver):
|
||||
self.__set_udc_enabled(True)
|
||||
|
||||
def __set_udc_enabled(self, enabled: bool) -> None:
|
||||
with open(self.__udc_path, "w") as udc_file:
|
||||
udc_file.write(self.__udc if enabled else "\n")
|
||||
with open(self.__udc_path, "w") as file:
|
||||
file.write(self.__udc if enabled else "\n")
|
||||
|
||||
def __is_udc_enabled(self) -> bool:
|
||||
with open(self.__udc_path) as udc_file:
|
||||
return bool(udc_file.read().strip())
|
||||
with open(self.__udc_path) as file:
|
||||
return bool(file.read().strip())
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"GPIO({self._instance_name})"
|
||||
|
||||
Reference in New Issue
Block a user