From: Lennart Poettering Date: Wed, 27 Jul 2005 18:44:47 +0000 (+0000) Subject: Make use of StateChanged signal of DBUS Server object X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=af3a124c8608fc516a0b78b25da0d4c96aef68da;p=catta Make use of StateChanged signal of DBUS Server object git-svn-id: file:///home/lennart/svn/public/avahi/trunk@172 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-daemon/dbus-test.py b/avahi-daemon/dbus-test.py index e57c35e..513c0e2 100755 --- a/avahi-daemon/dbus-test.py +++ b/avahi-daemon/dbus-test.py @@ -10,16 +10,22 @@ bus = dbus.SystemBus() server = dbus.Interface(bus.get_object("org.freedesktop.Avahi", '/org/freedesktop/Avahi/Server'), 'org.freedesktop.Avahi.Server') +def server_state_changed_callback(t): + print "Server::StateChanged: ", t + +server.connect_to_signal("StateChanged", server_state_changed_callback) + print "Host name: %s" % server.GetHostName() print "Domain name: %s" % server.GetDomainName() print "FQDN: %s" % server.GetHostNameFqdn() g = dbus.Interface(bus.get_object("org.freedesktop.Avahi", server.EntryGroupNew()), 'org.freedesktop.Avahi.EntryGroup') -def state_changed_callback(t): - print "StateChanged: ", t +def entry_group_state_changed_callback(t): + print "EntryGroup::StateChanged: ", t + +g.connect_to_signal('StateChanged', entry_group_state_changed_callback) -g.connect_to_signal('StateChanged', state_changed_callback) g.AddService(0, 0, "_http._tcp", "foo", "", "", dbus.UInt16(4712), ["fuck=hallo", "gurke=mega"]) g.AddAddress(0, 0, "foo.local", "47.11.8.15") g.Commit()