Преглед на файлове

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)