=== modified file 'install.sh' --- install.sh 2009-04-16 13:06:59 +0000 +++ install.sh 2012-08-30 15:13:30 +0000 @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -LIBFILES="imagewriter.py find_devices.sh" +LIBFILES="imagewriter.py find_devices" DATAFILES="imagewriter.glade header.png" === added file 'lib/find_devices' --- lib/find_devices 1970-01-01 00:00:00 +0000 +++ lib/find_devices 2012-08-30 15:13:30 +0000 @@ -0,0 +1,20 @@ +#!/usr/bin/python + +import dbus +import sys + +bus = dbus.SystemBus() +proxy = bus.get_object("org.freedesktop.UDisks", "/org/freedesktop/UDisks") +iface = dbus.Interface(proxy, "org.freedesktop.UDisks") + +devs = iface.EnumerateDevices() + +for dev in devs: + dev_obj = bus.get_object("org.freedesktop.UDisks", dev) + dev = dbus.Interface(dev_obj, "org.freedesktop.DBus.Properties") + + if str(dev.Get('', 'DriveConnectionInterface')) == 'usb' and not str(dev.Get('', 'PartitionType')) and str(dev.Get('', 'DeviceIsMediaAvailable')) == '1': + path = str(dev.Get('', 'DeviceFile')) + vend = str(dev.Get('', 'DriveVendor')) + model = str(dev.Get('', 'DriveModel')) + print vend + ' ' + model + ', ' +path === modified file 'lib/imagewriter.py' --- lib/imagewriter.py 2009-04-20 11:30:00 +0000 +++ lib/imagewriter.py 2012-08-30 15:13:30 +0000 @@ -76,7 +76,7 @@ self.window.show_all() def get_devices(self): - list = Popen(["/usr/lib/imagewriter/find_devices.sh"], stdout=PIPE).communicate()[0] + list = Popen(["/usr/lib/imagewriter/find_devices"], stdout=PIPE).communicate()[0] if not len(list): dialog = self.wTree.get_widget("nodev_dialog") dialog.run()