Closed bobpaul closed 3 years ago
Looks like a great candidate! We’ll get this in the queue.
The odd output structure of lsusb
makes this a hairy one, but I think I found a somewhat sane way to do it. This will be a fun one, for sure. :)
I am making progress on this parser. It's definitely a tough one, but it's over 80% complete now. Just need to finish a couple of items and then do some fine tuning. I hope to have a version to test in the next week or so.
I have a working version of the lsusb
parser in the dev
branch. Could you copy/paste the code from the link below into a file called lsusb.py
in your App data directory to test it?
https://github.com/kellyjonbrazil/jc/blob/dev/jc/parsers/lsusb.py
This is probably one of the most complex parsers I've written due to the many state changes required. Maybe there was a simpler way to do it, but I ended up at this this solution. I think match/case
functionality in Python 3.10 may make something like this easier in the future.
p.s. I only implemented lsusb
and lsusb -v
.
added in v1.17.1
Verbose I filtered this one to a single device. Without the filter the output is the same, but a block like this for each device.
Normal
Tree
Verbose Tree