cleanup_spinner() log.info("") try: while True: if adf: log.info("\nPage %d: Scanning..." % page) else: log.info("\nScanning...") bytes_read = 0 try: try: ok, expected_bytes, status = device.startScan( "RGBA", update_queue, event_queue) # Note: On some scanners (Marvell) expected_bytes will be < 0 (if lines == -1) log.debug("expected_bytes = %d" % expected_bytes) except scanext.error, e: sane.reportError(e) sys.exit(1) except KeyboardInterrupt: log.error("Aborted.") device.cancelScan() sys.exit(1) if adf and status == scanext.SANE_STATUS_NO_DOCS: if page - 1 == 0: log.error( "No document(s). Please load documents and try again." )
cleanup_spinner() log.info("") try: while True: if adf: log.info("\nPage %d: Scanning..." % page) else: log.info("\nScanning...") bytes_read = 0 try: try: ok, expected_bytes, status = device.startScan("RGBA", update_queue, event_queue) # Note: On some scanners (Marvell) expected_bytes will be < 0 (if lines == -1) log.debug("expected_bytes = %d" % expected_bytes) except scanext.error, e: sane.reportError(e) sys.exit(1) except KeyboardInterrupt: log.error("Aborted.") device.cancelScan() sys.exit(1) if adf and status == scanext.SANE_STATUS_NO_DOCS: if page-1 == 0: log.error("No document(s). Please load documents and try again.") sys.exit(0) else: