James R. Barlow
20ad032977
Fix some error messages that printed directly to sys.stderr instead of logging
2019-06-05 03:07:48 -07:00
James R. Barlow
93f1b73579
Fix --remove-vectors which was broken in API migration
...
It got dropped during the change. This feature has also been altered so that
the final visual appearance of the file is not affected, only the OCR image.
2019-06-05 02:04:45 -07:00
James R. Barlow
fd427a8ec1
plugins: replace path manipulation
2019-06-05 01:46:56 -07:00
James R. Barlow
9444cf357b
optimize: add divide by zero check
2019-06-04 02:01:53 -07:00
James R. Barlow
eb5200d26a
Change most tests to use ocrmypdf API instead of subprocess
...
The main benefit of this is code coverage gains can actually follow it.
Also removes most ugly os.environ hacks.
2019-06-03 01:45:27 -07:00
James R. Barlow
98a3fda1f5
Drop support for Tesseract 4 alpha releases without textonly_pdf (mostly)
...
hocr renderer can still be used
2019-06-03 01:39:41 -07:00
James R. Barlow
df9e286e9c
Make bypassed exception clearer
2019-06-01 01:35:15 -07:00
James R. Barlow
b9d6e46572
shutil.rmtree: use builtin error suppression
2019-05-31 15:12:46 -07:00
James R. Barlow
8347c0d662
validation: remove dead code check_input_file
2019-05-31 01:57:08 -07:00
James R. Barlow
45a361d112
Add option to use threads instead of processes
...
Mainly since they are more convenient for debugging
2019-05-31 01:56:16 -07:00
James R. Barlow
522e1e948b
ghostscript: don't use threads= for generate_pdfa
...
Not supported for pdfwrite
2019-05-31 01:55:29 -07:00
James R. Barlow
8ed4e229f3
ghostscript: avoid log=None construct
2019-05-30 13:57:38 -07:00
James R. Barlow
9d5f23e961
Rename filters to plugins
2019-05-28 02:39:25 -07:00
James R. Barlow
7566d4b768
Introduce plugins/filters
2019-05-27 16:55:04 -07:00
James R. Barlow
24855045e1
Provisionally add filters
2019-05-25 16:23:39 -07:00
James R. Barlow
ed236e0c27
Begin API documentation
2019-05-24 01:05:32 -07:00
James R. Barlow
db6aa22eae
Progress bar: unit types
2019-05-23 02:00:47 -07:00
James R. Barlow
805aa776ad
Re-disable progress bar when not connected to tty
2019-05-23 02:00:35 -07:00
James R. Barlow
d0efdf643c
Cleanup working files when done with a particular file, rather than end of process
2019-05-23 01:25:08 -07:00
James R. Barlow
22298b31be
Fix distinction between clean and clean_final lost in API refactor
2019-05-23 01:19:58 -07:00
James R. Barlow
a139e64c67
api: short-circuit exception handler, as caller should provide their own
2019-05-22 18:30:30 -07:00
James R. Barlow
db69b4d11a
Improve argparse behavior for its role in making the API work
2019-05-22 15:55:48 -07:00
James R. Barlow
09ca1bee97
Add progress bar to optimize and add option to disable it
2019-05-22 15:31:48 -07:00
James R. Barlow
23dd77ce0f
api: fix progress_bar_friendly=False
2019-05-22 15:31:03 -07:00
James R. Barlow
32a076c039
Refactor validation and exceptions
...
CLI now tracks check_options exceptions. API now works more like
an API, without an exception handler,
because the caller should provide one.
2019-05-20 18:01:17 -07:00
James R. Barlow
e4baa8c0dd
Remove sys.exit() calls so we don't terminate caller application
2019-05-20 15:08:20 -07:00
James R. Barlow
2fdaa76a0d
Refactor configure_logging
2019-05-20 14:54:34 -07:00
James R. Barlow
7ee0c52a57
Refactor cli into basic high level api
2019-05-19 22:34:45 -07:00
James R. Barlow
ac2fc9c2a0
Explain picklable logger
2019-05-19 15:06:47 -07:00
James R. Barlow
24da92d39e
Fix extra blank lines in output messages in Python 3.6
2019-05-17 14:56:33 -07:00
James R. Barlow
61afef549e
Remove some now-unused code; etc
2019-05-17 14:25:17 -07:00
James R. Barlow
cfd67ab6aa
Fixing threading._RLock exception on Python 3.6
...
Issue was the usual business: objects that cross process boundaries need
to be picklable and Python 3.6 is more strict about this. The logger
object in particular interfered, so now we suppress it and rebuild it
in process.
2019-05-17 14:24:47 -07:00
James R. Barlow
56067b590b
Make re_symlink() not require a log object
2019-05-17 01:59:36 -07:00
James R. Barlow
70def4a0d0
validation: eliminate print()
2019-05-17 01:43:26 -07:00
James R. Barlow
e528adc603
pylint removal
2019-05-17 01:09:06 -07:00
James R. Barlow
c1af0fb18d
Cleanup ghostscript error output
2019-05-17 00:50:29 -07:00
James R. Barlow
0cb4e854e5
Replace ProcessPoolExecutor with multiprocessing.Pool
...
There seems to be no reasonable way to handle Ctrl-C with a
ProcessPoolExecutor. Or at least you have to press it several times to
actually kill. Pool does the job.
2019-05-17 00:48:06 -07:00
James R. Barlow
13ab23ba54
Refactor weave_layers, introduce progress bar
...
Fixes a bug in this branch where --sidecar would fail by trying to iterator
the executor futures twice.
2019-05-16 14:57:31 -07:00
James R. Barlow
19263f00c6
Additional logging fixes; silence extremely verbose pdfminer logging
2019-05-16 13:44:44 -07:00
James R. Barlow
50bd129d7a
logging: don't pass log object to validation
2019-05-16 01:58:48 -07:00
James R. Barlow
471cdea232
Move app specific settings a library may not want to __main__
2019-05-16 01:29:26 -07:00
James R. Barlow
9d750828c7
Make logging format consistent with v8.3.0
2019-05-16 00:48:40 -07:00
James R. Barlow
5e025c3382
Reinstate log level in messages to be closer to old behavior
2019-05-15 15:46:36 -07:00
James R. Barlow
4410503349
More fixes to logging and disabled tests
2019-05-15 03:08:09 -07:00
James R. Barlow
486f73d5d6
Remove custom logger
2019-05-15 02:28:13 -07:00
James R. Barlow
b10285d11b
Fix warnings
2019-05-14 16:34:42 -07:00
James R. Barlow
c904b430b6
Merge master into api branch; all test pass
2019-05-14 16:33:02 -07:00
James R. Barlow
5adbddd1f9
ghostscript: rendering threads has no effect on pdfwrite, so remove it
...
See
https://www.ghostscript.com/doc/current/Language.htm
2019-05-12 03:36:07 -07:00
James R. Barlow
15a988b999
weave: use emplacement method, scrap TOC repair
...
The new emplacement method updates page objects in place without
generating new objgen numbers, meaning we no longer need to update the table
of contents to preserve links.
2019-05-11 12:40:25 -07:00
James R. Barlow
83398e54ea
weave: fix corruption of certain high page count files
...
Corruption occurred when replacements was not incremented for multiple
consecutive pages.
2019-05-11 12:22:21 -07:00