On Sun, 04 Dec 2011 20:17:52 +0000, Chris Mayo
<[email protected]> wrote:
> 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
Try this...
arg = QDBusArgument()
arg.beginArray(QMetaType.QString)
arg.add("")
arg.endArray()
...and pass arg to call().
If that works I'll change QDBusArgument so that you can do...
call("DeviceEject", QDBusArgument([""], QMetaType.QStringList))
Phil
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt