[PyQt] QtDBus: Calling a method with an Array of Strings signature with Python 3

Phil Thompson phil at riverbankcomputing.com
Mon Dec 5 21:31:04 GMT 2011


On Mon, 05 Dec 2011 19:12:33 +0000, Chris Mayo
<cjmayo at users.sourceforge.net> wrote:
>>
>> Try this...
>>
>> arg = QDBusArgument()
>> arg.beginArray(QMetaType.QString)
>> arg.add("")
>> arg.endArray()
>>
>> ....and pass arg to call().
> 
> Doesn't seem to work:
> 
> device_iface = QtDBus.QDBusInterface('org.freedesktop.UDisks',
> 	'/org/freedesktop/UDisks/devices/sr0', 'org.freedesktop.UDisks.Device',

> bus)
> 
> arg = QtDBus.QDBusArgument()
> arg.beginArray(QMetaType.QString)
> arg.add("")
> arg.endArray()
> 
> reply = device_iface.call("DriveEject", arg)
> print(reply.errorMessage())
> 
> 
> Returns:
> 
> Unknown option

...because "" is not a valid option? According to...

http://hal.freedesktop.org/docs/udisks/Device.html#Device.DriveEject

..."unmount" is the only valid option.

Phil


More information about the PyQt mailing list