From: Lennart Poettering Date: Tue, 15 Nov 2005 00:36:06 +0000 (+0000) Subject: remove dbus-test.py since it is horribly out of date X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=2d48326e6731cb9266119cd531daac0bbf683f44;p=catta remove dbus-test.py since it is horribly out of date git-svn-id: file:///home/lennart/svn/public/avahi/trunk@968 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-daemon/Makefile.am b/avahi-daemon/Makefile.am index 9819f56..6e0ac84 100644 --- a/avahi-daemon/Makefile.am +++ b/avahi-daemon/Makefile.am @@ -125,7 +125,6 @@ EXTRA_DIST = \ avahi-service.dtd \ avahi-daemon.conf \ example.service \ - dbus-test.py \ avahi-dbus.conf \ Server.introspect \ EntryGroup.introspect \ diff --git a/avahi-daemon/dbus-test.py b/avahi-daemon/dbus-test.py deleted file mode 100755 index a5adc0f..0000000 --- a/avahi-daemon/dbus-test.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/python2.4 - -import dbus, gobject -try: - import dbus.glib -except ImportError, e: - pass - -bus = dbus.SystemBus() -server = dbus.Interface(bus.get_object("org.freedesktop.Avahi", '/'), 'org.freedesktop.Avahi.Server') - -def server_state_changed_callback(t): - print "Server::StateChanged: ", t - -server.connect_to_signal("StateChanged", server_state_changed_callback) - -print "Version String: ", server.GetVersionString() - -print server.ResolveHostName(0, 0, "ecstasy.local", 0) -print server.ResolveAddress(0, 0, "192.168.50.4") - -print "Host name: %s" % server.GetHostName() -print "Domain name: %s" % server.GetDomainName() -print "FQDN: %s" % server.GetHostNameFqdn() -print "State: %i" % server.GetState() - -n = server.GetNetworkInterfaceNameByIndex(2) -print "network: 2 -> %s -> %i" % (n, server.GetNetworkInterfaceIndexByName(n)) - -print server.GetAlternativeHostName("gurkiman10") -print server.GetAlternativeServiceName("Ahuga Service") - -def entry_group_state_changed_callback(t): - print "EntryGroup::StateChanged: ", t - - if t == 1: - print server.ResolveHostName(0, 0, "foo.local", 0) - -g = dbus.Interface(bus.get_object("org.freedesktop.Avahi", server.EntryGroupNew()), 'org.freedesktop.Avahi.EntryGroup') -g.connect_to_signal('StateChanged', entry_group_state_changed_callback) -g.AddService(0, 0, "Test Web Site", "_http._tcp", "", "", dbus.UInt16(4712), ["fuck=hallo", "gurke=mega"]) -g.AddAddress(0, 0, "foo.local", "47.11.8.15") -g.Commit() - -def domain_browser_callback(a, interface, protocol, domain): - print "DOMAIN_BROWSER: %s %i %i %s" % (a, interface, protocol, domain) - -db = dbus.Interface(bus.get_object("org.freedesktop.Avahi", server.DomainBrowserNew(0, 0, "", 2)), 'org.freedesktop.Avahi.DomainBrowser') -db.connect_to_signal('ItemNew', lambda interface, protocol, domain: domain_browser_callback("NEW", interface, protocol, domain)) -db.connect_to_signal('ItemRemove', lambda interface, protocol, domain: domain_browser_callback("REMOVE", interface, protocol, domain)) - -def service_type_browser_callback(a, interface, protocol, type, domain): - print "SERVICE_TYPE_BROWSER: %s %i %i %s %s" % (a, interface, protocol, type, domain) - -stb = dbus.Interface(bus.get_object("org.freedesktop.Avahi", server.ServiceTypeBrowserNew(0, 0, "")), 'org.freedesktop.Avahi.ServiceTypeBrowser') -stb.connect_to_signal('ItemNew', lambda interface, protocol, type, domain: service_type_browser_callback("NEW", interface, protocol, type, domain)) -stb.connect_to_signal('ItemRemove', lambda interface, protocol, type, domain: service_type_browser_callback("REMOVE", interface, protocol, type, domain)) - -def service_browser_callback(a, interface, protocol, name, type, domain): - print "SERVICE_BROWSER: %s %i %i %s %s %s" % (a, interface, protocol, name, type, domain) - - if a == "NEW": - print server.ResolveService(interface, protocol, name, type, domain, 0) - -sb = dbus.Interface(bus.get_object("org.freedesktop.Avahi", server.ServiceBrowserNew(0, 0, "_http._tcp", "")), 'org.freedesktop.Avahi.ServiceBrowser') -sb.connect_to_signal('ItemNew', lambda interface, protocol, name, type, domain: service_browser_callback("NEW", interface, protocol, name, type, domain)) -sb.connect_to_signal('ItemRemove', lambda interface, protocol, name, type, domain: service_browser_callback("REMOVE", interface, protocol, name, type, domain)) - -try: - gobject.MainLoop().run() -except KeyboardInterrupt, k: - pass - -g.Free() -db.Free() -stb.Free() - -print "Quit"