mirror of
https://github.com/Leseratte10/acsm-calibre-plugin.git
synced 2024-12-23 01:34:36 +06:00
More Python2 cleanup
This commit is contained in:
parent
3a460ae1fd
commit
171c6f36ba
@ -37,7 +37,8 @@
|
|||||||
# Ignore fatal HTTP errors and/or a missing or broken server during optional
|
# Ignore fatal HTTP errors and/or a missing or broken server during optional
|
||||||
# fulfillment notifications, allow authorizing an eReader through USB (experimental),
|
# fulfillment notifications, allow authorizing an eReader through USB (experimental),
|
||||||
# drop dependencies python-cryptography, python-rsa and python-pyasn1.
|
# drop dependencies python-cryptography, python-rsa and python-pyasn1.
|
||||||
# add a ton of testing code, try to prevent AV false-positives.
|
# add a ton of testing code, try to prevent AV false-positives,
|
||||||
|
# experimental support for Python2 / Calibre < 5.
|
||||||
|
|
||||||
PLUGIN_NAME = "DeACSM"
|
PLUGIN_NAME = "DeACSM"
|
||||||
PLUGIN_VERSION_TUPLE = (0, 0, 15)
|
PLUGIN_VERSION_TUPLE = (0, 0, 15)
|
||||||
@ -70,10 +71,9 @@ class DeACSM(FileTypePlugin):
|
|||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
"""
|
"""
|
||||||
On initialization, make sure we have all the libraries (python-rsa, cryptography,
|
On initialization, make sure we have all the libraries (oscrypto and its dependency
|
||||||
oscrypto and their dependencies asn1crypto and pyasn1) that the plugin needs.
|
asn1crypto) that the plugin needs. Unfortunately the Adobe encryption is kinda weird
|
||||||
Unfortunately the Adobe encryption is kinda weird and nonstandard and doesn't work
|
and nonstandard and doesn't work with just the python modules included with Calibre.
|
||||||
with just the python modules included with Calibre.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -198,12 +198,6 @@ def makeSerial(random):
|
|||||||
|
|
||||||
mac_address = get_mac_address()
|
mac_address = get_mac_address()
|
||||||
|
|
||||||
if sys.version_info[0] >= 3:
|
|
||||||
dataToHash = "%d:%s:%02x:%02x:%02x:%02x:%02x:%02x\x00" % (uid, username,
|
|
||||||
mac_address[0], mac_address[1], mac_address[2],
|
|
||||||
mac_address[3], mac_address[4], mac_address[5])
|
|
||||||
|
|
||||||
else:
|
|
||||||
dataToHash = "%d:%s:%02x:%02x:%02x:%02x:%02x:%02x\x00" % (uid, username,
|
dataToHash = "%d:%s:%02x:%02x:%02x:%02x:%02x:%02x\x00" % (uid, username,
|
||||||
mac_address[0], mac_address[1], mac_address[2],
|
mac_address[0], mac_address[1], mac_address[2],
|
||||||
mac_address[3], mac_address[4], mac_address[5])
|
mac_address[3], mac_address[4], mac_address[5])
|
||||||
|
Loading…
Reference in New Issue
Block a user