开发者

How to handle properties of a dbus interface with python?

开发者 https://www.devze.com 2023-01-26 18:01 出处:网络
I\'m about to work on an implementation 开发者_JAVA百科of mpris. But currently I am not sure how to read/write dbus interface properties with python-dbus. Is there any examples for this ?Finally got t

I'm about to work on an implementation 开发者_JAVA百科of mpris. But currently I am not sure how to read/write dbus interface properties with python-dbus. Is there any examples for this ?


Finally got the answer:

@dbus.service.method(dbus.PROPERTIES_IFACE, in_signature='ss', out_signature='v')
def Get(self, interface, prop):
    ...
@dbus.service.method(dbus.PROPERTIES_IFACE, in_signature='ssv')
def Set(self, interface, prop, value):
    ...
@dbus.service.method(dbus.PROPERTIES_IFACE, in_signature='s', out_signature='a{sv}')
def GetAll(self, interface):
    ...
0

精彩评论

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