开发者

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')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜