如何使用python处理dbus接口的属性?

时间:2010-11-25 13:56:20

标签: python linux dbus

我即将开展mpris的实施工作。但目前我不确定如何使用python-dbus读/写dbus接口属性。有没有这方面的例子?

1 个答案:

答案 0 :(得分:4)

终于得到了答案:

@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):
    ...