summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-07-27 18:44:47 +0000
committerLennart Poettering <lennart@poettering.net>2005-07-27 18:44:47 +0000
commitaf3a124c8608fc516a0b78b25da0d4c96aef68da (patch)
treee233d5f73d47c854670d5a12a5ea9cfabfbcb64d
parentcc7bb72552184951e806f4d0f2449629b35b9c93 (diff)
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
-rwxr-xr-xavahi-daemon/dbus-test.py12
1 files changed, 9 insertions, 3 deletions
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()