mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-12-30 08:41:40 +00:00
Executing a package with python -m packagename will check for __main__.py inside the package. In other words main.py should have always been named __main__.py. In the unlikely event that someone depends on "import ocrmypdf.main" being meaningful, main.py continues to exist and replicates the behavior of __main__. (It's unlikely because import ocrmypdf.main does unpythonic ruffus-related things at things import time, essentially configuring itself to work with sys.argv. To fix another day.) This should solve the problem of Debian needing to run test suites before installation and afterwards for continuous integration without having to patch either file, as python -m ocrmypdf will follow import order. That is, if the current directory contains "ocrmypdf/" (e.g. staging a new version) then that will be tested, else sys.path will be checked.
8 lines
188 B
Python
8 lines
188 B
Python
#!/usr/bin/env python3
|
|
# © 2015-16 James R. Barlow: github.com/jbarlow83
|
|
|
|
# This file is now an alias for __main__
|
|
# Consider removing in future releases
|
|
|
|
from ocrmypdf.__main__ import *
|