summaryrefslogtreecommitdiff
path: root/kvmd/plugins
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-03-17 23:41:59 +0200
committerMaxim Devaev <[email protected]>2023-03-17 23:41:59 +0200
commitdbb9eda3416a79a26bb6b738aecab0c43c8c84e5 (patch)
treef730671f358ec6f0adad5edddfe008760476b2e8 /kvmd/plugins
parent166cb8e3b7a08dd6b56ac317b58e7b280dcb3bef (diff)
refactoring
Diffstat (limited to 'kvmd/plugins')
-rw-r--r--kvmd/plugins/msd/otg/__init__.py7
-rw-r--r--kvmd/plugins/ugpio/otgconf.py4
2 files changed, 4 insertions, 7 deletions
diff --git a/kvmd/plugins/msd/otg/__init__.py b/kvmd/plugins/msd/otg/__init__.py
index d8175975..d286fc84 100644
--- a/kvmd/plugins/msd/otg/__init__.py
+++ b/kvmd/plugins/msd/otg/__init__.py
@@ -417,11 +417,8 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
await asyncio.sleep(5)
with Inotify() as inotify:
- for path in [
- *self.__storage.get_watchable_paths(),
- *self.__drive.get_watchable_paths(),
- ]:
- await inotify.watch(path, InotifyMask.ALL_MODIFY_EVENTS)
+ await inotify.watch(InotifyMask.ALL_MODIFY_EVENTS, *self.__storage.get_watchable_paths())
+ await inotify.watch(InotifyMask.ALL_MODIFY_EVENTS, *self.__drive.get_watchable_paths())
# После установки вотчеров еще раз проверяем стейт, чтобы ничего не потерять
await self.__reload_state()
diff --git a/kvmd/plugins/ugpio/otgconf.py b/kvmd/plugins/ugpio/otgconf.py
index 194475c3..a2604c98 100644
--- a/kvmd/plugins/ugpio/otgconf.py
+++ b/kvmd/plugins/ugpio/otgconf.py
@@ -82,8 +82,8 @@ class Plugin(BaseUserGpioDriver):
await asyncio.sleep(5)
with Inotify() as inotify:
- await inotify.watch(os.path.dirname(self.__udc_path), InotifyMask.ALL_MODIFY_EVENTS)
- await inotify.watch(self.__profile_path, InotifyMask.ALL_MODIFY_EVENTS)
+ await inotify.watch(InotifyMask.ALL_MODIFY_EVENTS, os.path.dirname(self.__udc_path))
+ await inotify.watch(InotifyMask.ALL_MODIFY_EVENTS, self.__profile_path)
self._notifier.notify()
while True:
need_restart = False