Dbus interface properties
Cezary Czajka
cz.czajka at gmail.com
Thu May 15 08:30:25 PDT 2014
Hi all,
I am new here. I have problem with dbus interface properties. I have to
write fake of dbus service and I don't know how I can add properties to
interface 'net.dumm.download'. I can add methods and signals to
Interface but interface 'net.dumm.download' in class DMObject doesn't
have any methods and signals. It has only properties. I don't know how
correct to write 'Set' method. I think that I should add properties to
this interface in __init__ method but not sure
Can someone help me.
class DMObject(dbus.service.Object):
def __init__(self):
bus_name = dbus.service.BusName( 'net.dumm', bus =
dbus.SessionBus())
Object = dbus.service.Object.__init__ ( self, bus_name,
'/DMObject/212')
dmInterf = dbus.Interface(self, 'net.dumm.download')
### add properties to inter
print dmInter
@dbus.service.method(dbus.PROPERTIES_IFACE, in_signature='ss',
out_signature='v')
def Get(self, interface, prop):
pass
@dbus.service.method(dbus.PROPERTIES_IFACE, in_signature='ssv')
def Set(self, interface, prop, value):
pass
@dbus.service.method(dbus.PROPERTIES_IFACE, in_signature='s',
out_signature='a{sv}')
def GetAll(self, interface):
pass
DBusGMainLoop(set_as_default=True)
myservice = DummService()
Gtk.main()
More information about the dbus
mailing list