]> git.meshlink.io Git - catta/commitdiff
Make use of StateChanged signal of DBUS Server object
authorLennart Poettering <lennart@poettering.net>
Wed, 27 Jul 2005 18:44:47 +0000 (18:44 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 27 Jul 2005 18:44:47 +0000 (18:44 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@172 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-daemon/dbus-test.py

index e57c35ee63a94bf2ea37a7978ccd4e9692242307..513c0e29bff2e13468eb888fa8db50ac4567b902 100755 (executable)
@@ -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()