[PyQt] QtDBus: Calling a method with an Array of Strings signature with Python 3
Chris Mayo
cjmayo at users.sourceforge.net
Sun Dec 4 20:17:52 GMT 2011
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
More information about the PyQt
mailing list