summaryrefslogtreecommitdiff
path: root/hplip-avahi-parsing.patch
diff options
context:
space:
mode:
Diffstat (limited to 'hplip-avahi-parsing.patch')
-rw-r--r--hplip-avahi-parsing.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/hplip-avahi-parsing.patch b/hplip-avahi-parsing.patch
new file mode 100644
index 0000000..029040b
--- /dev/null
+++ b/hplip-avahi-parsing.patch
@@ -0,0 +1,19 @@
+diff -up hplip-3.15.2/base/avahi.py.parsing hplip-3.15.2/base/avahi.py
+--- hplip-3.15.2/base/avahi.py.parsing 2015-02-04 15:43:37.662551377 +0100
++++ hplip-3.15.2/base/avahi.py 2015-02-04 15:45:56.576564858 +0100
+@@ -52,9 +52,14 @@ def detectNetworkDevices(ttl=4, timeout=
+ 'status_code': 0, 'device2': '0', 'device3': '0', 'note': ''}
+ y['ip'] = ip
+ y['hn'] = bits[6].replace('.local', '')
+- details = bits[9].split('" "')
++ details = bits[9].rstrip ().strip ('"').split('" "')
+ for item in details:
+ key, value = item.split('=', 1)
++ keyvalue = item.split('=', 1)
++ if len (keyvalue) < 2:
++ # Skip parts that don't match key=value
++ continue
++ key, value = keyvalue
+ if key == 'ty':
+ y['mdns'] = value
+ y['device1'] = "MFG:Hewlett-Packard;MDL:%s;CLS:PRINTER;" % value