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