diff options
author | Sebastien Estienne <sebastien.estienne@gmail.com> | 2005-10-04 16:14:23 +0000 |
---|---|---|
committer | Sebastien Estienne <sebastien.estienne@gmail.com> | 2005-10-04 16:14:23 +0000 |
commit | b43e6b19808b4fb0ea7fc7ecf7670888c094cf15 (patch) | |
tree | 14d2434c0b655e8deb8d2ea237690ac74556ee24 /src/service-discovery-applet.in | |
parent | 1180ca5544328d79ae4032a1855d2ec788ecda4d (diff) |
* remove old sh scripts system
* support avahi 0.4 by skipping exceptions on IsLocal
git-svn-id: file:///home/lennart/svn/public/service-discovery-applet/trunk@34 3be567f1-68ff-0310-b24a-ad7cc433fd2f
Diffstat (limited to 'src/service-discovery-applet.in')
-rwxr-xr-x | src/service-discovery-applet.in | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/service-discovery-applet.in b/src/service-discovery-applet.in index 41d9445..4331f73 100755 --- a/src/service-discovery-applet.in +++ b/src/service-discovery-applet.in @@ -145,16 +145,6 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): txts = avahi.txt_array_to_string_array(txt) txts = services.pair_to_dict(txts) services.handle(name, type, host, address, port, txts) -# if os.path.exists("@scriptsdir@/%s.sh" % type): -# cmd = [] -# cmd.append("@scriptsdir@/%s.sh" % type) -# cmd.append("%s" % name) -# cmd.append("%s" % host) -# cmd.append("%s" % address) -# cmd.append("%i" % port) -# cmd.append('%s' % " ".join(avahi.txt_array_to_string_array(txt))) -# print cmd -# pid = subprocess.Popen(cmd).pid def print_error(self, err): print "Error:", str(err) @@ -165,9 +155,12 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): def new_service(self, interface, protocol, name, type, domain): print "Found service '%s' of type '%s' in domain '%s' on %s.%i." % (name, type, domain, self.siocgifname(interface), protocol) - if self.show_local_services == False: - if self.server.IsServiceLocal( interface, protocol, name, type, domain) == True: - return + try: + if self.show_local_services == False: + if self.server.IsServiceLocal( interface, protocol, name, type, domain) == True: + return + except dbus.dbus_bindings.DBusException: + pass if self.zc_types.has_key(type) == False: menuitem = gtk.ImageMenuItem() @@ -200,13 +193,13 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): def remove_service(self, interface, protocol, name, type, domain): print "Service '%s' of type '%s' in domain '%s' on %s.%i disappeared." % (name, type, domain, self.siocgifname(interface), protocol) - if self.show_local_services == False: - # FIXME avahi bug? - if self.server.IsServiceLocal( interface, protocol, name, type, domain) == True: - print "is local" - return - else: - print "is NOT local" + try: + if self.show_local_services == False: + # FIXME avahi bug? + if self.server.IsServiceLocal( interface, protocol, name, type, domain) == True: + return + except dbus.dbus_bindings.DBusException: + pass if self.zc_services.has_key((interface, protocol, name, type, domain)): self.zc_types[type].remove(self.zc_services[(interface, protocol, name, type, domain)]) |