Mercurial > hg > config
changeset 737:8806a699ff94
wip, untested
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Fri, 13 Mar 2015 10:40:59 -0700 |
parents | 0dd3144d3bdc |
children | 6833137f039c 8a9fe2f20bcb |
files | python/mountusb.py |
diffstat | 1 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/python/mountusb.py Thu Mar 12 11:36:00 2015 -0700 +++ b/python/mountusb.py Fri Mar 13 10:40:59 2015 -0700 @@ -34,13 +34,17 @@ options = parser.parse_args(args) dmesg = subprocess.check_output(['dmesg']).splitlines() - string = 'usbcore: registered new interface driver usb-storage' - for index in reversed(range(len(dmesg))): - line = dmesg[index] - if string in line: - break + for string in ('usbcore: registered new interface driver usb-storage', + 'USB Mass Storage device detecte'): + for index in reversed(range(len(dmesg))): + line = dmesg[index] + if string in line: + break + else: + continue + break else: - sys.exit(1) # nothing found + sys.exit(1) for line in dmesg[index:]: line = line.split(']', 1)[-1].strip()