def enable_inotify(self):
self._wm = pyinotify.WatchManager()
self._notifier = pyinotify.Notifier(self._wm, lambda *a, **b: False)
self._wm.add_watch('/dev/input', pyinotify.IN_CREATE, False)
self.daemon.get_poller().register(self._notifier._fd,
self.daemon.get_poller().POLLIN, self._inotify_cb)
评论列表
文章目录