I just posted this on linuxprinting.foomatic.devel, but I guess some
here might have the same problem, namely that the HPLIP printer
drivers fail when combined with CUPS' Backend Error Handler:


To fully utilize the capabilities of our HP LaserJets I recently
installed HPLIP and was quite pissed off at the fact that it doesn't
work with BEH---I had almost forgotten how much work BEH had saved me
killing users' stuck print jobs and manually restarting the printer in
CUPS. So I started digging in the HPLIP sources today and got it working
with a trivial patch:

# diff /usr/share/hplip/base/device.py.orig
# /usr/share/hplip/base/device.py
47c47
< pat_deviceuri = 
re.compile(r"""(.*?):/(.*?)/(\S*?)\?(?:serial=(\S*)|device=(\S*)|ip=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}[^&]*))(?:&port=(\d))?""",
 re.IGNORECASE)
---
> pat_deviceuri = 
> re.compile(r"""(.*):/(.*?)/(\S*?)\?(?:serial=(\S*)|device=(\S*)|ip=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}[^&]*))(?:&port=(\d))?""",
>  re.IGNORECASE)

I.e. I just removed the first question mark in the RE to make it greedy
again. Now it seems to work fine with my printers.conf:
DeviceURI beh:/1/3/120/cupspykota:hp:/net/HP_LaserJet_4100_Series?ip=12.34.56.78

This hasn't been tested extensively yet so I may be missing something
and the patch might break more that it fixes on other configs, but maybe
some of you would like to give it a try. Comments welcome.

cheers!
        Matthias
-- 
I prefer encrypted and signed messages. KeyID: FAC37665
Fingerprint: 8C16 3F0A A6FC DF0D 19B0  8DEF 48D9 1700 FAC3 7665

Attachment: pgp6eOP0xKts0.pgp
Description: PGP signature

Reply via email to