Skip to content

Commit

Permalink
Don't hide import errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrin authored and Leseratte10 committed Oct 23, 2021
1 parent aca0157 commit 344b199
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions calibre-plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,24 +114,16 @@ def initialize(self):
from calibre_plugins.deacsm.libadobe import VAR_HOBBES_VERSION, createDeviceKeyFile, update_account_path
from calibre_plugins.deacsm.libadobeAccount import createDeviceFile, createUser, signIn, activateDevice
except:
try:
from libadobe import VAR_HOBBES_VERSION, createDeviceKeyFile, update_account_path
from libadobeAccount import createDeviceFile, createUser, signIn, activateDevice
except:
print("{0} v{1}: Error while importing Account stuff".format(PLUGIN_NAME, PLUGIN_VERSION))
traceback.print_exc()
from libadobe import VAR_HOBBES_VERSION, createDeviceKeyFile, update_account_path
from libadobeAccount import createDeviceFile, createUser, signIn, activateDevice

# Fulfill:
try:
from calibre_plugins.deacsm.libadobe import sendHTTPRequest
from calibre_plugins.deacsm.libadobeFulfill import buildRights, fulfill
except:
try:
from libadobe import sendHTTPRequest
from libadobeFulfill import buildRights, fulfill
except:
print("{0} v{1}: Error while importing Fulfillment stuff".format(PLUGIN_NAME, PLUGIN_VERSION))
traceback.print_exc()
from libadobe import sendHTTPRequest
from libadobeFulfill import buildRights, fulfill

import calibre_plugins.deacsm.prefs as prefs # type: ignore
deacsmprefs = prefs.DeACSM_Prefs()
Expand Down Expand Up @@ -184,21 +176,13 @@ def download(self, replyData: str):
from calibre_plugins.deacsm.libadobe import sendHTTPRequest_DL2FILE
from calibre_plugins.deacsm.libadobeFulfill import buildRights, fulfill
except:
try:
from libadobe import sendHTTPRequest_DL2FILE
from libadobeFulfill import buildRights, fulfill
except:
print("{0} v{1}: Error while importing Fulfillment stuff".format(PLUGIN_NAME, PLUGIN_VERSION))
traceback.print_exc()
from libadobe import sendHTTPRequest_DL2FILE
from libadobeFulfill import buildRights, fulfill

try:
from calibre_plugins.deacsm.libpdf import patch_drm_into_pdf
except:
try:
from libpdf import patch_drm_into_pdf
except:
print("{0} v{1}: Error while importing PDF patch".format(PLUGIN_NAME, PLUGIN_VERSION))
traceback.print_exc()
from libpdf import patch_drm_into_pdf


adobe_fulfill_response = etree.fromstring(replyData)
Expand Down Expand Up @@ -301,13 +285,8 @@ def run(self, path_to_ebook: str):
from calibre_plugins.deacsm.libadobe import sendHTTPRequest
from calibre_plugins.deacsm.libadobeFulfill import buildRights, fulfill
except:
try:
from libadobe import sendHTTPRequest
from libadobeFulfill import buildRights, fulfill
except:
print("{0} v{1}: Error while importing Fulfillment stuff".format(PLUGIN_NAME, PLUGIN_VERSION))
traceback.print_exc()

from libadobe import sendHTTPRequest
from libadobeFulfill import buildRights, fulfill

import calibre_plugins.deacsm.prefs as prefs # type: ignore
deacsmprefs = prefs.DeACSM_Prefs()
Expand Down

0 comments on commit 344b199

Please sign in to comment.