X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-python%2Favahi-bookmarks.in;h=6466a221de28c1236484ce5c11974bad4d1e2a1b;hb=f386380ed985f6a720195e9a7075e3fe912ea9b2;hp=74037bbc2298adf4a83dd002f3420a75ac801bef;hpb=b95ccf4806b9820f9e61a6a43ea3710817f3dfc4;p=catta diff --git a/avahi-python/avahi-bookmarks.in b/avahi-python/avahi-bookmarks.in index 74037bb..6466a22 100755 --- a/avahi-python/avahi-bookmarks.in +++ b/avahi-python/avahi-bookmarks.in @@ -33,8 +33,8 @@ except ImportError: pass try: - from twisted.internet import gtk2reactor - gtk2reactor.install() + from twisted.internet import glib2reactor + glib2reactor.install() from twisted.internet import reactor from twisted.web import server, resource except ImportError: @@ -45,7 +45,7 @@ urlproto = { "_http._tcp" : "http", "_https._tcp" : "https", "_ftp._tcp" : "ftp port = 8080 address = "127.0.0.1" -use_host_names = False +use_host_names = None domain = "local" class AvahiBookmarks(resource.Resource): @@ -53,7 +53,7 @@ class AvahiBookmarks(resource.Resource): services = {} - def __init__(self): + def __init__(self, use_host_names): resource.Resource.__init__(self) self.bus = dbus.SystemBus() @@ -65,6 +65,14 @@ class AvahiBookmarks(resource.Resource): self.browse_service_type("_https._tcp") self.browse_service_type("_ftp._tcp") + if use_host_names is None: + try: + self.use_host_names = self.server.IsNSSSupportAvailable() + except: + self.use_host_names = False + else: + self.use_host_names = use_host_names + def browse_service_type(self, stype): global domain @@ -109,14 +117,14 @@ class AvahiBookmarks(resource.Resource): t += '
Served by %s