From 5fe71c7c2c4ff561f0a05c9178fe1a2e7707f0a8 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Fri, 31 Jan 2020 09:19:09 +0100 Subject: Fix detection of SD cards The device name is for example mmcblk2. Previously, it was considered that name ending with a number was a partition. Now, we don't consider a device only if it has 'org.freedesktop.UDisks2.Partition' interface. --- lib/isodumper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/isodumper.py b/lib/isodumper.py index 5b1801f..4db8e4e 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -81,12 +81,12 @@ class UDisks2(object): list=[] for block in blocks: - if not block['path'][-1].isdigit(): + if not (self.SERVICE + '.Partition' in objects[block['path']]): # we skip partition blocks for dev in devs: - if dev['path'] == objects[block['path']][self.BLOCK]['Drive']: + if dev['path'] == objects[block['path']][self.BLOCK]['Drive']: # we look for device which is referenced in Drive attribute of the current block dev_obj =objects[dev['path']][self.DRIVE] if (dev_obj['ConnectionBus'] == 'usb' or dev_obj['ConnectionBus'] == 'sdio') and \ - (dev_obj['Removable'] == 1 or dev_obj['MediaRemovable'] == 1 ): + (dev_obj['Removable'] == 1 or dev_obj['MediaRemovable'] == 1 ): # we keep only blocks where device ConnectionBus is sdio or usb item=[] vend = dev_obj['Vendor'] if vend == "": -- cgit v1.2.1