def __iter__(self): """ Iterate over all matching devices. Yield :class:`Device` objects. """ libudev.udev_enumerate_scan_devices(self) entry = libudev.udev_enumerate_get_list_entry(self) for name, _ in udev_list_iterate(entry): yield Device.from_sys_path(self.context, name)
def new_func(context, device, recursive=True): """ New function wraps yielded value in Device. :param `Context` context: udev context :param `Device` device: device to start from :param bool recursive: if False, only show immediate slaves """ for directory in func(device.sys_path, recursive): yield Device.from_sys_path(context, directory)
def __iter__(self): """ Iterate over all matching devices. Yield :class:`Device` objects. """ self._libudev.udev_enumerate_scan_devices(self) entry = self._libudev.udev_enumerate_get_list_entry(self) for name, _ in udev_list_iterate(self._libudev, entry): yield Device.from_sys_path(self.context, name)
def __iter__(self): """ Iterate over all matching devices. Yield :class:`Device` objects. """ self._libudev.udev_enumerate_scan_devices(self) entry = self._libudev.udev_enumerate_get_list_entry(self) for name, _ in udev_list_iterate(self._libudev, entry): try: yield Device.from_sys_path(self.context, name) except DeviceNotFoundAtPathError: continue