Finalize ‘exec’ migration and make it backward compatibility for now

This commit is contained in:
James R. Barlow
2017-01-18 17:40:50 -08:00
parent f246779b8e
commit 6e27ecd2b9
4 changed files with 15 additions and 6 deletions
+8 -3
View File
@@ -1,4 +1,3 @@
import os
import pkg_resources
PROGRAM_NAME = 'ocrmypdf'
@@ -6,5 +5,11 @@ PROGRAM_NAME = 'ocrmypdf'
VERSION = pkg_resources.get_distribution('ocrmypdf').version
def page_number(input_file):
return int(os.path.basename(input_file)[0:6])
# These imports are for v4.x backward compatibility for consumers of ocrmypdf
# (if any). They are deprecated and will be removed in v5.x.
from .exec import ghostscript, qpdf, tesseract, unpaper, get_program
from .exceptions import ExitCode
from .helpers import page_number, is_iterable_notstr