diff options
author | Sascha 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) |
commit | 6be79c4d1f8ad118e21b75985087292ae530a6b2 (patch) | |
tree | d67152c4b3b2c1793cb661c69a2f409091c89d3a | |
parent | 1869c3a407b959ecffd45cf9472148c1913a58f9 (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.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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: |