Code sync
[external/hplip.git] / packaging / mdns-py-network-printer-search-key-error.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## mdns-py-network-printer-search-key-error.dpatch by  <till.kamppeter@gmail.com>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: No description.
6
7 @DPATCH@
8 diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' hplip-3.11.7~/base/mdns.py hplip-3.11.7/base/mdns.py
9 --- hplip-3.11.7~/base/mdns.py  2011-07-24 21:07:17.000000000 +0200
10 +++ hplip-3.11.7/base/mdns.py   2011-09-01 00:37:39.191408840 +0200
11 @@ -308,8 +308,10 @@
12                          off += l
13  
14                      log.debug("TXT: %s" % repr(txt))
15 -                    y['device1'] = "MFG:Hewlett-Packard;MDL:%s;CLS:PRINTER;" % txt['ty']
16 -
17 +                    try:
18 +                        y['device1'] = "MFG:Hewlett-Packard;MDL:%s;CLS:PRINTER;" % txt['ty']
19 +                    except KeyError:
20 +                        log.debug("NO ty Key in txt: %s" % repr(txt))
21                      if 'note' in txt:
22                          y['note'] = txt['note']
23