Workaround the broken hackery that the DOC Input plugin does, that causes it to break the Input Options Preferences in calibre 2.0

This commit is contained in:
Kovid Goyal 2014-08-28 09:47:42 +05:30
parent 24ae2e1d75
commit 2c4ffa1700
2 changed files with 13 additions and 7 deletions

View File

@ -1048,6 +1048,11 @@ class InputOptions(PreferencesPlugin):
config_widget = 'calibre.gui2.preferences.conversion:InputOptions' config_widget = 'calibre.gui2.preferences.conversion:InputOptions'
description = _('Set conversion options specific to each input format') description = _('Set conversion options specific to each input format')
def create_widget(self, *args, **kwargs):
# The DOC Input plugin tries to override this
self.config_widget = 'calibre.gui2.preferences.conversion:InputOptions'
return PreferencesPlugin.create_widget(self, *args, **kwargs)
class CommonOptions(PreferencesPlugin): class CommonOptions(PreferencesPlugin):
name = 'Common Options' name = 'Common Options'
icon = I('convert.png') icon = I('convert.png')

View File

@ -27,6 +27,7 @@ def config_widget_for_input_plugin(plugin):
'calibre.gui2.convert.'+name).PluginWidget 'calibre.gui2.convert.'+name).PluginWidget
except ImportError: except ImportError:
# If this is not a builtin plugin, we have to import it differently # If this is not a builtin plugin, we have to import it differently
if plugin.__module__ and plugin.__module__.startswith('calibre_plugins.'):
try: try:
ans = importlib.import_module(plugin.__module__+'.'+name).PluginWidget ans = importlib.import_module(plugin.__module__+'.'+name).PluginWidget
except (ImportError, AttributeError, TypeError): except (ImportError, AttributeError, TypeError):