Parcourir la source

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 il y a 4 ans
Parent
commit
23cf0d71bb
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  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)