Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2013-05-28 16:05:49 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2013-05-28 16:05:49 (GMT)
commit6be79c4d1f8ad118e21b75985087292ae530a6b2 (patch)
treed67152c4b3b2c1793cb661c69a2f409091c89d3a
parent1869c3a407b959ecffd45cf9472148c1913a58f9 (diff)
Re-open scanner after each scan to work around HPLIP/SANE bugs
With recent versions of HPLIP and SANE, my HP OfficeJet 4500 doesn't properly finish an ADF job. All images get returned, but the device is still busy afterwards, refusing to scan anything else. Closing the device finishes the job, allowing further scans after opening the device again.
-rw-r--r--scan.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scan.py b/scan.py
index b8a5b98..faa403d 100644
--- a/scan.py
+++ b/scan.py
@@ -525,10 +525,10 @@ class ScanThread(threading.Thread):
self._images = images
finally:
- logging.debug('_scan(): closing iterator')
+ logging.debug('_scan_multi(): closing iterator')
# make sure the scan is "cancelled" _now_
del scan_iter
- logging.debug('_scan(): iterator closed')
+ logging.debug('_scan_multi(): iterator closed')
@trace()
def _check_action(self, actions):
@@ -906,8 +906,9 @@ class ScanActivity(activity.Activity):
if not exc:
self._set_status('ready')
- else:
- self._open_scanner(self._current_scanner_name)
+
+ # always re-open scanner, to work around HPLIP bugs
+ self._open_scanner(self._current_scanner_name)
def _add_images(self, image_infos):
for info in image_infos: