]> git.meshlink.io Git - catta/blobdiff - avahi-utils/avahi-bookmarks.in
Include qt mainloop adapter in build system. Moc finding code is cracktastic thanks to
[catta] / avahi-utils / avahi-bookmarks.in
index 2dd01beedcf7e90a82046dc4633283a4f58175f9..07ca8f06e79decfd6dbd335cf774ae8658379edd 100755 (executable)
@@ -38,7 +38,7 @@ try:
     from twisted.internet import reactor
     from twisted.web import server, resource
 except ImportError:
-    print "Sorry, to use this tool you need to install twisted."
+    print "Sorry, to use this tool you need to install twisted and twisted.web."
     sys.exit(1)
 
 urlproto = { "_http._tcp" : "http",  "_https._tcp" : "https", "_ftp._tcp" : "ftp" }
@@ -96,7 +96,12 @@ class AvahiBookmarks(resource.Resource):
 
                 path = self.find_path(v[4])
 
-                t += '<li><a href="%s://%s%s%s">%s</a></li>' % (urlproto[k[3]], v[2], port, path, k[2])
+                if v[1] == avahi.PROTO_INET6:
+                    ip = "[" + v[2] + "]"
+                else:
+                    ip = v[2]
+
+                t += '<li><a href="%s://%s%s%s">%s</a></li>' % (urlproto[k[3]], ip, port, path, k[2])
                 
             t += '</ul>'