Fix GUI extension with non-English Calibre

This commit is contained in:
Florian Bach 2022-10-23 10:06:54 +02:00
parent f641a1e72d
commit 3bd4d28936
2 changed files with 14 additions and 4 deletions

View File

@ -48,7 +48,9 @@
# #
# v0.1.0: Continue work on renaming from "DeACSM" to "ACSM Input". # v0.1.0: Continue work on renaming from "DeACSM" to "ACSM Input".
# The big version number jump is to make that name change clearer. # The big version number jump is to make that name change clearer.
# Print useful warning if LicenseServiceCertificate download fails. # Print useful warning if LicenseServiceCertificate download fails,
# fix error with the loan list not being updated when importing multiple ACSMs at once,
# fix bug with the GUI extension in non-English environments,
@ -138,8 +140,15 @@ class ACSMInput(FileTypePlugin):
if os.path.exists(os.path.join(self.pluginsdir, "DeACSM.zip")): if os.path.exists(os.path.join(self.pluginsdir, "DeACSM.zip")):
os.rename(os.path.join(self.pluginsdir, "DeACSM.zip"), os.path.join(self.pluginsdir, "DeACSM.BAK")) os.rename(os.path.join(self.pluginsdir, "DeACSM.zip"), os.path.join(self.pluginsdir, "DeACSM.BAK"))
try:
# Make sure the GUI extension is loaded: # Make sure the GUI extension is loaded:
self.init_embedded_plugins() self.init_embedded_plugins()
except:
# Apparently this can fail - if it does, ignore errors so the rest of the plugin still works.
print("{0} v{1}: Couldn't initialize GUI plugin:".format(PLUGIN_NAME, PLUGIN_VERSION))
traceback.print_exc()
pass
self.maindir_old = os.path.join(self.pluginsdir,"DeACSM") self.maindir_old = os.path.join(self.pluginsdir,"DeACSM")
self.maindir = os.path.join(self.pluginsdir,"ACSMInput") self.maindir = os.path.join(self.pluginsdir,"ACSMInput")

View File

@ -10,6 +10,7 @@ try:
except: except:
pass pass
from calibre_plugins.deacsm.__init__ import ACSMInput
#@@CALIBRE_COMPAT_CODE@@ #@@CALIBRE_COMPAT_CODE@@
@ -25,7 +26,7 @@ class ACSMInputGUIExtension(InterfaceActionBase):
# This plugin will be auto-loaded from the ACSM Input plugin. It doesn't make sense for the user # This plugin will be auto-loaded from the ACSM Input plugin. It doesn't make sense for the user
# to disable it. If necessary, the menu bar button can be removed through the Calibre settings. # to disable it. If necessary, the menu bar button can be removed through the Calibre settings.
type = "File type" type = ACSMInput.type
# Just so that the GUI extension shows up at the same place as the actual ACSM Input plugin. # Just so that the GUI extension shows up at the same place as the actual ACSM Input plugin.
try: try: