mirror of
https://github.com/Leseratte10/acsm-calibre-plugin.git
synced 2024-12-22 17:29:56 +06:00
Cleanup
This commit is contained in:
parent
b9f6672a4c
commit
b2b88abd06
@ -325,12 +325,18 @@ def sendPOSTHTTPRequest(URL, document, type, returnRC = False):
|
||||
except uliberror.HTTPError as err:
|
||||
# This happens with HTTP 500 and related errors.
|
||||
print("Post request caused HTTPError %d" % (err.code))
|
||||
if returnRC:
|
||||
return err.code, "Post request caused HTTPException"
|
||||
else:
|
||||
return None
|
||||
|
||||
except uliberror.URLError as err:
|
||||
# This happens if the hostname cannot be resolved.
|
||||
print("Post request failed with URLError")
|
||||
if returnRC:
|
||||
return 900, "Post request failed with URLError"
|
||||
|
||||
else:
|
||||
return None
|
||||
|
||||
ret_code = handler.getcode()
|
||||
if (ret_code == 204 and returnRC):
|
||||
|
@ -144,11 +144,10 @@ def buildAuthRequest():
|
||||
|
||||
user_pkcs12 = base64.b64decode(activationxml.find("./%s/%s" % (adNS("credentials"), adNS("pkcs12"))).text)
|
||||
|
||||
|
||||
try:
|
||||
from calibre_plugins.deacsm.libadobe import devkey_bytes as devkey_adobe
|
||||
except:
|
||||
from libadobe import devkey_bytes as devkey_adobe
|
||||
except:
|
||||
pass
|
||||
|
||||
if devkey_adobe is not None:
|
||||
devkey_bytes = devkey_adobe
|
||||
|
@ -34,10 +34,7 @@ def importADEactivationLinuxWine(wine_prefix_path, buildIDtoEmulate=VAR_VER_DEFA
|
||||
pass
|
||||
|
||||
# Get encryption key
|
||||
try:
|
||||
from getEncryptionKeyLinux import GetMasterKey
|
||||
except:
|
||||
from calibre_plugins.deacsm.getEncryptionKeyLinux import GetMasterKey
|
||||
|
||||
master_key = GetMasterKey(wine_prefix_path)
|
||||
|
||||
@ -120,10 +117,7 @@ def importADEactivationWindows(buildIDtoEmulate=VAR_VER_DEFAULT_BUILD_ID):
|
||||
return False, "Windows only!"
|
||||
|
||||
# Get encryption key:
|
||||
try:
|
||||
from getEncryptionKeyWindows import GetMasterKey
|
||||
except:
|
||||
from calibre_plugins.deacsm.getEncryptionKeyWindows import GetMasterKey
|
||||
|
||||
master_key = GetMasterKey()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user