Coverage for linuxpy/usb/core.py: 0%
4 statements
« prev ^ index » next coverage.py v7.6.8, created at 2025-05-27 13:54 +0200
« prev ^ index » next coverage.py v7.6.8, created at 2025-05-27 13:54 +0200
1from . import usbfs, usbsys
4def iter_devices():
5 # we can retrieve device list and descriptors from sysfs or usbfs.
6 # sysfs is preferable, because if we use usbfs we end up resuming
7 # any autosuspended USB devices. however, sysfs is not available
8 # everywhere, so we need a usbfs fallback too.
9 func = usbsys.iter_devices if usbsys.is_available else usbfs.iter_devices
10 yield from func()