Compare commits

..

1 Commits

Author SHA1 Message Date
Aleksa Sarai 8228e38d5a Merge ad33aea18d into 10b6caf9f5 2023-08-05 07:57:31 -07:00
12 changed files with 8 additions and 40 deletions
+2 -3
View File
@@ -14,8 +14,7 @@ if "calibre" in sys.modules and sys.version_info[0] == 2:
if os.path.join(config_dir, "plugins", "DeDRM.zip") not in sys.path:
sys.path.insert(0, os.path.join(config_dir, "plugins", "DeDRM.zip"))
if "calibre" in sys.modules:
# Explicitly set the package identifier so we are allowed to import stuff ...
__package__ = "calibre_plugins.dedrm"
# Explicitly set the package identifier so we are allowed to import stuff ...
__package__ = "calibre_plugins.dedrm"
#@@CALIBRE_COMPAT_CODE_END@@
+1 -12
View File
@@ -5,21 +5,10 @@
# (CLI interface without Calibre)
# Copyright © 2021 NoDRM
"""
NOTE: This code is not functional (yet). I started working on it a while ago
to make a standalone version of the plugins that could work without Calibre,
too, but for now there's only a rough code structure and no working code yet.
Currently, to use these plugins, you will need to use Calibre. Hopwfully that'll
change in the future.
"""
__license__ = 'GPL v3'
__docformat__ = 'restructuredtext en'
# For revision history see CHANGELOG.md
# For revision history see __init__.py
"""
Run DeDRM plugin without Calibre.
+1 -4
View File
@@ -5,10 +5,7 @@
# For use with Topaz Scripts Version 2.6
# Python 3, September 2020
#@@CALIBRE_COMPAT_CODE@@
from .utilities import SafeUnbuffered
from utilities import SafeUnbuffered
import sys
import csv
-2
View File
@@ -49,8 +49,6 @@
__version__ = '2.0'
#@@CALIBRE_COMPAT_CODE@@
import sys, struct, os, traceback
import zlib
import zipfile
+1 -3
View File
@@ -4,9 +4,7 @@
# Python 3 for calibre 5.0
from __future__ import print_function
#@@CALIBRE_COMPAT_CODE@@
from .utilities import SafeUnbuffered
from utilities import SafeUnbuffered
import sys
import csv
-2
View File
@@ -45,8 +45,6 @@ import os
import hashlib
import base64
#@@CALIBRE_COMPAT_CODE@@
try:
from Cryptodome.Cipher import AES
except ImportError:
-2
View File
@@ -27,8 +27,6 @@ import hashlib
import getopt
import re
#@@CALIBRE_COMPAT_CODE@@
from .utilities import SafeUnbuffered
try:
-2
View File
@@ -70,8 +70,6 @@ def unpad(data, padding=16):
return data[:-pad_len]
#@@CALIBRE_COMPAT_CODE@@
from .utilities import SafeUnbuffered
from .argv_utils import unicode_argv
+1 -2
View File
@@ -92,14 +92,13 @@ def unpad(data, padding=16):
return data[:-pad_len]
#@@CALIBRE_COMPAT_CODE@@
from .utilities import SafeUnbuffered
from .argv_utils import unicode_argv
iswindows = sys.platform.startswith('win')
isosx = sys.platform.startswith('darwin')
from .argv_utils import unicode_argv
class ADEPTError(Exception):
pass
+1 -4
View File
@@ -30,9 +30,6 @@ import struct
from io import BytesIO
#@@CALIBRE_COMPAT_CODE@@
try:
from Cryptodome.Cipher import AES
from Cryptodome.Util.py3compat import bchr
@@ -60,7 +57,7 @@ except ImportError:
# Windows-friendly choice: pylzma wheels
import pylzma as lzma
from .kfxtables import *
from kfxtables import *
TID_NULL = 0
TID_BOOLEAN = 1
-2
View File
@@ -62,8 +62,6 @@ except NameError:
# Routines common to Mac and PC
#@@CALIBRE_COMPAT_CODE@@
from .utilities import SafeUnbuffered
from .argv_utils import unicode_argv
+1 -2
View File
@@ -16,9 +16,8 @@
import sys
import binascii
#@@CALIBRE_COMPAT_CODE@@
from .utilities import SafeUnbuffered
from .argv_utils import unicode_argv
letters = b'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789'