agl / jbig2enc

JBIG2 Encoder
Other
251 stars 86 forks source link

enhancement of pdf.py #66

Open aont opened 4 years ago

aont commented 4 years ago
lzlarryli commented 2 years ago

Thank you so much @aont. I can confirm this works with Python 3.

One suggestion: maybe switch the first line to

#!/usr/bin/env python

so that the script is more robust.

MacOS 12.3 deprecated Python2. So pdf.py is not longer usable without this PR.

wizardforcel commented 1 year ago

but __str__ is corresponding to __bytes__ not get_bytes

HinTak commented 6 months ago

2nd on __bytes__ too. (and use bytes(x) instead of x.get_bytes(). BTW, it would also be useful not to include unnecessary white-space changes ( in line 140-150-ish) - this makes reviewing easier.

python 2 has been deprecated for a while. It is probably simply to get rid of all the conditionals about py2 too.

aont commented 1 month ago

@lzlarryli thanks for the reply.

!/usr/bin/env python

This may work on MacOS12.3 as you say, but on some of Linux distros not. It's because they do not provide python but python3. ( maybe to discern from python2. ) In addition, on Windows, python3.exe is not provided but python.exe.

Do you have any proposal?

aont commented 1 month ago

@wizardforcel thanks for the reply. You mean __bytes__ is appropriate rather than get_bytes ?

aont commented 1 month ago

@HinTak thanks for the reply.

it would also be useful not to include unnecessary white-space changes ( in line 140-150-ish) - this makes reviewing easier.

Oh, you are right. but I already removed fork repo, I hesitate to create new one... (In addition, the maintainer is not watching PRs...?)