Merge pull request #489 from wzyboy/backports/pylzma
Support pylzma as a fallback
This commit is contained in:
commit
dd09da7dd9
|
@ -23,13 +23,17 @@ from Crypto.Util.py3compat import bchr, bord
|
|||
try:
|
||||
# lzma library from calibre 2.35.0 or later
|
||||
import lzma.lzma1 as calibre_lzma
|
||||
except:
|
||||
except ImportError:
|
||||
calibre_lzma = None
|
||||
try:
|
||||
import lzma
|
||||
except:
|
||||
except ImportError:
|
||||
# Need pip backports.lzma on Python <3.3
|
||||
try:
|
||||
from backports import lzma
|
||||
except ImportError:
|
||||
# Windows-friendly choice: pylzma wheels
|
||||
import pylzma as lzma
|
||||
|
||||
|
||||
TID_NULL = 0
|
||||
|
|
|
@ -15,9 +15,9 @@ except ImportError:
|
|||
from StringIO import StringIO
|
||||
|
||||
try:
|
||||
import ion
|
||||
except:
|
||||
from calibre_plugins.dedrm import ion
|
||||
except ImportError:
|
||||
import ion
|
||||
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
|
|
|
@ -23,13 +23,17 @@ from Crypto.Util.py3compat import bchr, bord
|
|||
try:
|
||||
# lzma library from calibre 2.35.0 or later
|
||||
import lzma.lzma1 as calibre_lzma
|
||||
except:
|
||||
except ImportError:
|
||||
calibre_lzma = None
|
||||
try:
|
||||
import lzma
|
||||
except:
|
||||
except ImportError:
|
||||
# Need pip backports.lzma on Python <3.3
|
||||
try:
|
||||
from backports import lzma
|
||||
except ImportError:
|
||||
# Windows-friendly choice: pylzma wheels
|
||||
import pylzma as lzma
|
||||
|
||||
|
||||
TID_NULL = 0
|
||||
|
|
|
@ -15,9 +15,9 @@ except ImportError:
|
|||
from StringIO import StringIO
|
||||
|
||||
try:
|
||||
import ion
|
||||
except:
|
||||
from calibre_plugins.dedrm import ion
|
||||
except ImportError:
|
||||
import ion
|
||||
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
|
|
|
@ -23,13 +23,17 @@ from Crypto.Util.py3compat import bchr, bord
|
|||
try:
|
||||
# lzma library from calibre 2.35.0 or later
|
||||
import lzma.lzma1 as calibre_lzma
|
||||
except:
|
||||
except ImportError:
|
||||
calibre_lzma = None
|
||||
try:
|
||||
import lzma
|
||||
except:
|
||||
except ImportError:
|
||||
# Need pip backports.lzma on Python <3.3
|
||||
try:
|
||||
from backports import lzma
|
||||
except ImportError:
|
||||
# Windows-friendly choice: pylzma wheels
|
||||
import pylzma as lzma
|
||||
|
||||
|
||||
TID_NULL = 0
|
||||
|
|
|
@ -15,9 +15,9 @@ except ImportError:
|
|||
from StringIO import StringIO
|
||||
|
||||
try:
|
||||
import ion
|
||||
except:
|
||||
from calibre_plugins.dedrm import ion
|
||||
except ImportError:
|
||||
import ion
|
||||
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
|
|
|
@ -107,6 +107,15 @@ In addition, Windows Users need PyCrypto:
|
|||
|
||||
Once Windows users have installed Python 2.7, and the matching PyCrypto, they are ready to run the DeDRM application or individual scripts.
|
||||
|
||||
For (experimental) KFX support, you also need LZMA support. LZMA is built-in
|
||||
in Python 3.3+ but not present in Python 2. Choices are backports.lzma and
|
||||
pylzma, both of which need compiling. Compiling Python extensions on Windows
|
||||
requires Visual Studio and is a PITA. The recommended way is to install wheels
|
||||
(binary) directly.
|
||||
|
||||
Windows binary wheels for backports.lzma and pylzma could be found here:
|
||||
|
||||
https://www.lfd.uci.edu/~gohlke/pythonlibs/
|
||||
|
||||
|
||||
Apple's iBooks FairPlay DRM
|
||||
|
|
Loading…
Reference in New Issue