Add script that find mass storage devices on a computer

pull/2/head
Raphaël Vinot 2015-05-19 01:16:26 +02:00
parent 5d419f711a
commit b2447d9d56
2 changed files with 17 additions and 0 deletions

1
playground/README.md Normal file
View File

@ -0,0 +1 @@
This directory contains files that may of may not be used in the project

16
playground/usb_lookup.py Normal file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from usb.core import find
import usb.control
def is_mass_storage(dev):
import usb.util
for cfg in dev:
if usb.util.find_descriptor(cfg, bInterfaceClass=8) is not None:
return True
for mass in find(find_all=True, custom_match=is_mass_storage):
print(mass)