get dbus.Struct properties
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_s开发者_StackOverflow社区ubject:Re: email subject'),), signature=None) I need to get the inner string.
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')
精彩评论