Reputation: 23
I'm trying to write a notification script using python-dbus. How can I get properties from a dbus.Struct object? For example if I print it out as string, it is dbus.Struct((dbus.String(u'msg_subject:Re: email subject'),), signature=None) I need to get the inner string.
Upvotes: 2
Views: 1884
Reputation: 37929
Looks like dbus.Struct
inherits from tuple, so you should be able to do this:
>>> msg = dbus.Struct((dbus.String(u'msg_subject:Re: email subject'),), signature=None)
>>> msg[0]
dbus.String(u'msg_subject:Re: email subject')
Upvotes: 4