瀏覽代碼

Update to track library changes

* .address field is now an array of addresses.

* .update_service() method now required by API even if it does nothing.
Rob Austein 4 年之前
父節點
當前提交
23cf0d71bb
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      printer_browser.py

+ 5 - 2
printer_browser.py

@@ -37,6 +37,9 @@ class Listener:
     def remove_service(self, z, type, name):
         pass
 
+    def update_service(self, z, type, name):
+        pass
+
     def get(self):
         "Iterator to retrieve ServiceInfo results"
         while True:
@@ -115,9 +118,9 @@ def main():
         rrs.append(txt_rr(p))
 
         if not args.quiet:
-            addr = inet_ntop({4:AF_INET, 6:AF_INET6}[len(p.address)], p.address)
             write(";; Name: {!r}".format(p.name))
-            write(";; Addr: {} ({})".format(addr, p.server))
+            for a in p.addresses:
+                write(";; Addr: {} ({})".format(inet_ntop({4:AF_INET, 16:AF_INET6}[len(a)], a), p.server))
             write(";;")
         for rr in rrs:
             write(rr)