View Single Post
Old 06-13-2011, 10:33 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The class LinuxScanner in scanner.py is what scans /sys and returns a tuple of

(vendor id, product id, bcd, manufacturer, product name, serial number)

This tuple is used by the is_usb_connected methods defined in devices/interface.py to check if a device class matches one of the tuples returned by the scanner.

is_usb_connected also uses can_handle() which is typicall overridden in actual device drivers.

Finally, when an device is found its open() method is called which is responsible for mounting the device and setting the paths to the main memory/storage cvards of the device. See open_linux() in usbms/device.py
kovidgoyal is offline   Reply With Quote