With Python 2 I can do (where /dev/sr0 is a cdrom):

bus = QtDBus.QDBusConnection.systemBus()
device_iface = QtDBus.QDBusInterface('org.freedesktop.UDisks',
'/org/freedesktop/UDisks/devices/sr0', 'org.freedesktop.UDisks.Device', bus)
reply = device_iface.call("DriveEject", QStringList())


But with Python 3 this won't work because of QStringList. If I modify it with:

reply = device_iface.call("DriveEject", ["", ])
print(reply.errorMessage())

I get:

Method "DriveEject" with signature "av" on interface "org.freedesktop.UDisks.Device" doesn't exist

Chris

PyQt-x11-gpl-snapshot-4.9-65564eb2fcf4
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to