summaryrefslogtreecommitdiff
path: root/kvmd/plugins
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-03-07 23:54:05 +0200
committerMaxim Devaev <[email protected]>2023-03-07 23:54:05 +0200
commitf652eca9c213dd783cf2ffd02109b2353ccb86c1 (patch)
tree3c2a5c68e0b03536ec5c482b9b5be708795e8292 /kvmd/plugins
parent002031baf15d328dad764a620e1c83c01e7a55a6 (diff)
refactoring
Diffstat (limited to 'kvmd/plugins')
-rw-r--r--kvmd/plugins/auth/radius.py4
-rw-r--r--kvmd/plugins/hid/otg/device.py4
-rw-r--r--kvmd/plugins/msd/otg/drive.py8
-rw-r--r--kvmd/plugins/ugpio/otgconf.py8
4 files changed, 12 insertions, 12 deletions
diff --git a/kvmd/plugins/auth/radius.py b/kvmd/plugins/auth/radius.py
index d7c6390e..94d27883 100644
--- a/kvmd/plugins/auth/radius.py
+++ b/kvmd/plugins/auth/radius.py
@@ -426,8 +426,8 @@ class Plugin(BaseAuthService):
assert user == user.strip()
assert user
try:
- with io.StringIO(_FREERADUIS_DICT) as dct_file:
- dct = pyrad.dictionary.Dictionary(dct_file)
+ with io.StringIO(_FREERADUIS_DICT) as file:
+ dct = pyrad.dictionary.Dictionary(file)
client = pyrad.client.Client(
server=self.__host,
authport=self.__port,
diff --git a/kvmd/plugins/hid/otg/device.py b/kvmd/plugins/hid/otg/device.py
index 630ad186..e8b4302a 100644
--- a/kvmd/plugins/hid/otg/device.py
+++ b/kvmd/plugins/hid/otg/device.py
@@ -172,8 +172,8 @@ class BaseDeviceProcess(multiprocessing.Process): # pylint: disable=too-many-in
return get_logger()
def __is_udc_configured(self) -> bool:
- with open(self.__udc_state_path) as udc_state_file:
- return (udc_state_file.read().strip().lower() == "configured")
+ with open(self.__udc_state_path) as file:
+ return (file.read().strip().lower() == "configured")
def __write_report(self, report: bytes) -> bool:
assert report
diff --git a/kvmd/plugins/msd/otg/drive.py b/kvmd/plugins/msd/otg/drive.py
index 9fc947ab..e5dbdbb1 100644
--- a/kvmd/plugins/msd/otg/drive.py
+++ b/kvmd/plugins/msd/otg/drive.py
@@ -75,13 +75,13 @@ class Drive:
# =====
def __get_param(self, param: str) -> str:
- with open(os.path.join(self.__lun_path, param)) as param_file:
- return param_file.read().strip()
+ with open(os.path.join(self.__lun_path, param)) as file:
+ return file.read().strip()
def __set_param(self, param: str, value: str) -> None:
try:
- with open(os.path.join(self.__lun_path, param), "w") as param_file:
- param_file.write(value + "\n")
+ with open(os.path.join(self.__lun_path, param), "w") as file:
+ file.write(value + "\n")
except OSError as err:
if err.errno == errno.EBUSY:
raise MsdDriveLockedError()
diff --git a/kvmd/plugins/ugpio/otgconf.py b/kvmd/plugins/ugpio/otgconf.py
index 28eae8fe..e24c26b9 100644
--- a/kvmd/plugins/ugpio/otgconf.py
+++ b/kvmd/plugins/ugpio/otgconf.py
@@ -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})"