Author: gnichols Date: 2012-03-29 00:19:55 +0000 (Thu, 29 Mar 2012) New Revision: 1248
Modified: trunk/v7/udisksDeviceDetector.py Log: changlog
Modified: trunk/v7/udisksDeviceDetector.py =================================================================== --- trunk/v7/udisksDeviceDetector.py 2012-03-29 00:16:07 UTC (rev 1247) +++ trunk/v7/udisksDeviceDetector.py 2012-03-29 00:19:55 UTC (rev 1248) @@ -46,23 +46,26 @@
def getDevices(self): devices = list() - for devicePath in self.interface.EnumerateDevices(): - device = self.bus.get_object(self.rootObject, devicePath) - deviceProperties = dbus.Interface(device, dbus.PROPERTIES_IFACE) - #try: - if True: - if deviceProperties.Get("org.freedesktop.UDisks.Device", "DeviceIsDrive"): - devices.append(UDisksDrive(device)) - elif deviceProperties.Get("org.freedesktop.UDisks.Device", "DeviceIsPartition"): - devices.append(UDisksPartition(device)) - else: - devices.append(UDisksDevice(device)) - #except Exception, e: - #print e - - for adapterPath in self.interface.EnumerateAdapters(): - adapter = self.bus.get_object(self.rootObject, adapterPath) - devices.append(UDisksAdapter(adapter)) + try: + for devicePath in self.interface.EnumerateDevices(): + device = self.bus.get_object(self.rootObject, devicePath) + deviceProperties = dbus.Interface(device, dbus.PROPERTIES_IFACE) + if True: + if deviceProperties.Get("org.freedesktop.UDisks.Device", "DeviceIsDrive"): + devices.append(UDisksDrive(device)) + elif deviceProperties.Get("org.freedesktop.UDisks.Device", "DeviceIsPartition"): + devices.append(UDisksPartition(device)) + else: + devices.append(UDisksDevice(device)) + + for adapterPath in self.interface.EnumerateAdapters(): + adapter = self.bus.get_object(self.rootObject, adapterPath) + devices.append(UDisksAdapter(adapter)) + + except dbus.DBusException, e: + if self.debugging: + print "Could not get devices from UDisks:" + print e
return devices
v7-commits@lists.stg.fedorahosted.org