Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for python 3 #6

Merged
merged 4 commits into from
Feb 9, 2022
Merged

Add support for python 3 #6

merged 4 commits into from
Feb 9, 2022

Conversation

v--
Copy link
Collaborator

@v-- v-- commented Jan 31, 2022

Python 2 has been out of extended support for over a year and I did some minor changes so that the source is compatible with Python 3 (without breaking backward compatibility).

The changes are truly minor. I ran 2to3 on the source and it only replaced the print statements with calls to the print function. I also changed the binary to python since it is now compatible with both Python 2 and Python 3.

I added a poetry file that lists sexpdata as a dependency. This can be used to publish dpsprep to Pypi so that it can be installed via pip, poetry and other tools.

I cannot list binaries as dependencies, however I added checks for whether the required binaries (djvu2hocr, ddjvu, ddjvused and pdftk) are present.

There is also work done to port ocrodjvu to Python 3 (jwilk-archive/ocrodjvu#39), however djvu2hocr from ocrodjvu it is run as a binary and hence it is irrelevant what language it is written in.

I tested the script with several books and it did what it is intended to do.

Feel free to cherry-pick only the commits that seem meaningful to you.

@kcroker
Copy link
Owner

kcroker commented Feb 2, 2022

Thank you for your improvements to the project! I will check this out on the weekend and will accept the PR as soon as I've verified it on my end.

@kcroker kcroker merged commit 3d657d7 into kcroker:master Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants