Commit Graph
23 Commits
Author SHA1 Message Date
JMR-devandClaude Opus 4.8 838700fbec Remove Python 2 compatibility shims
The plugins target calibre 5/6 (Python 3) and the Poetry environment
pins Python >=3.8, so the Python 2 fallbacks are dead code. This removes
them throughout both plugins (behaviour on Python 3 is unchanged):

  - Drop all `from __future__` imports.
  - Collapse `if sys.version_info[0] == 2: ... else: ...` blocks to their
    Python 3 branch (ineptpdf, mobidedrm, kindlekey, kgenpids, alfcrypto,
    erdr2pml, ineptepub, obok, and the various unpad() helpers, etc.).
  - Replace `_winreg` import fallbacks with plain `import winreg`, and
    delete the py2-only adobekey_winreg_unicode module (now unreferenced).
  - Drop py2 name shims: `unicode`/`unichr`, `.iteritems()`,
    `from StringIO import StringIO`, `htmlentitydefs` fallback, and the
    Windows CommandLineToArgvW dance in unicode_argv (py3 sys.argv is
    already Unicode on every platform).
  - Remove the "Calibre < 5" (py2) bugfix block from the compat header.

Verified: every .py file in both plugins still byte-compiles.

Scope: the maintained DeDRM_plugin and Obok_plugin only. The archival
standalone scripts under Other_Tools/ are left as historical snapshots.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:42:33 -05:00
NoDRM 10b6caf9f5 Enable autorelease into 2nd repo 2023-08-03 21:53:16 +02:00
NoDRM 53996cf49c More Python2 fixes 2023-08-03 20:45:06 +02:00
NoDRM ca6d30b2d9 More stuff I missed 2022-08-06 20:25:07 +02:00
NoDRM b283777c0a Add back unpad to fix Python2 support 2022-03-19 10:14:45 +01:00
a980e066a01 a1dd63ae5f Remove OpenSSL support; only support PyCryptodome
This allows us to clean up the code a lot.

On Windows, it isn't installed by default and
most of the time not be found at all.

On M1 Macs, the kernel will kill the process instead.

Closes #33.
2022-03-18 15:45:39 +00:00
NoDRM 5b3e3e420f Make plugin work in Calibre 6 (Qt 6) 2022-01-02 21:18:13 +01:00
NoDRM f17b255159 Add "MemoryError" to FAQ 2022-01-02 19:13:37 +01:00
NoDRMandAdriano Caloiaro b84cf9aeb8 Fix libcrypto DLL path search (see #13 and #14)
Co-authored-by: Adriano Caloiaro <code@adriano.fyi>
2022-01-02 17:29:27 +01:00
NoDRM cdd6402b9a Fix username decryption with unicode chars in Python2 2021-12-20 21:07:44 +01:00
NoDRM d05594dcbc Update to v10.0.2 2021-11-29 17:06:18 +01:00
Florian Bach e9a6e80e5a Fix username code for ADE key retrieval 2021-11-29 16:23:10 +01:00
Derek Tracy 1545d76803 Support Python 2.7 and Python 3 winreg imports on Windows 2021-11-16 21:22:13 +01:00
NoDRM 90910ab106 Add back Python2 support (ADEPT) 2021-11-16 11:09:03 +01:00
NoDRM 066e613cee Add UUID to adobekey DER file names 2021-11-15 10:47:09 +01:00
Threak d7ddc2ab93 Try new openssl library name 2021-02-26 18:50:10 +01:00
Apprentice Harper 781268e17e More general changes, and get mobidedrm and kindlekey to work on Mac. 2020-10-14 16:23:49 +01:00
Apprentice Harper ff8d44492e Fix problem on Mac with byte arrays. 2020-09-30 13:25:32 +01:00
Apprentice Harper de50a02af9 More generic 3.0 changes, to be tested. 2020-09-27 11:54:49 +01:00
kubik147 2800f7cd80 Remove the u string prefixes 2020-09-27 00:57:53 +02:00
kubik147 61c5096da0 Make adobekey.py work in Python 3 2020-09-27 00:54:40 +02:00
Apprentice Harper afa4ac5716 Starting on Version 7.0 using the work done by others. Completely untested. I will be testing things, but I thought I'd get this base version up for others to give pull requests.
THIS IS ON THE MASTER BRANCH. The Master branch will be Python 3.0 from now on. While Python 2.7 support will not be deliberately broken, all efforts should now focus on Python 3.0 compatibility.

I can see a lot of work has been done. There's more to do. I've bumped the version number of everything I came across to the next major number for Python 3.0 compatibility indication.

Thanks everyone. I hope to update here at least once a week until we have a stable 7.0 release for calibre 5.0
2020-09-26 21:22:47 +01:00
Apprentice Harper 92bf51bc8f Remove stand-alone apps. Only support the two plugins. 2020-02-16 10:12:25 +00:00