Fix Python2 bugs in GUI code

This commit is contained in:
Florian Bach
2022-10-09 10:56:44 +02:00
parent 69329fe09a
commit 7e9153e294
3 changed files with 35 additions and 9 deletions
+10 -3
View File
@@ -10,7 +10,10 @@
from calibre.customize import InterfaceActionBase # type: ignore
from calibre.customize import PluginInstallationType
try:
from calibre.customize import PluginInstallationType
except:
pass
class DeACSMMigrationPlugin(InterfaceActionBase):
@@ -28,8 +31,12 @@ class DeACSMMigrationPlugin(InterfaceActionBase):
type = "File type"
# Just so that the GUI extension shows up at the same place as the actual ACSM Input plugin.
installation_type = PluginInstallationType.EXTERNAL
# Mark this as user-installed so it shows up in the plugin list by default.
try:
installation_type = PluginInstallationType.EXTERNAL
# Mark this as user-installed so it shows up in the plugin list by default.
except:
# Setting the Installation type doesn't always work on Calibre 4 and below.
pass
actual_plugin = "calibre_plugins.deacsm.migration:ActualMigrationPlugin"