mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use absolute imports for input/output widgets
This commit is contained in:
parent
725a5b2794
commit
9a0b018643
@ -4,8 +4,6 @@ __license__ = 'GPL 3'
|
|||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from PyQt4.Qt import QString, SIGNAL
|
from PyQt4.Qt import QString, SIGNAL
|
||||||
|
|
||||||
from calibre.gui2.convert.single import Config, sort_formats_by_preference, \
|
from calibre.gui2.convert.single import Config, sort_formats_by_preference, \
|
||||||
@ -64,10 +62,10 @@ class BulkConfig(Config):
|
|||||||
toc = widget_factory(TOCWidget)
|
toc = widget_factory(TOCWidget)
|
||||||
|
|
||||||
output_widget = None
|
output_widget = None
|
||||||
name = 'calibre.gui2.convert.%s' % self.plumber.output_plugin.name.lower().replace(' ', '_')
|
name = self.plumber.output_plugin.name.lower().replace(' ', '_')
|
||||||
try:
|
try:
|
||||||
__import__(name)
|
output_widget = __import__('calibre.gui2.convert.'+name,
|
||||||
output_widget = sys.modules[name]
|
fromlist=[1])
|
||||||
pw = output_widget.PluginWidget
|
pw = output_widget.PluginWidget
|
||||||
pw.ICON = ':/images/back.svg'
|
pw.ICON = ':/images/back.svg'
|
||||||
pw.HELP = _('Options specific to the output format.')
|
pw.HELP = _('Options specific to the output format.')
|
||||||
|
@ -142,10 +142,10 @@ class Config(ResizableDialog, Ui_Dialog):
|
|||||||
toc = widget_factory(TOCWidget)
|
toc = widget_factory(TOCWidget)
|
||||||
|
|
||||||
output_widget = None
|
output_widget = None
|
||||||
name = 'calibre.gui2.convert.%s' % self.plumber.output_plugin.name.lower().replace(' ', '_')
|
name = self.plumber.output_plugin.name.lower().replace(' ', '_')
|
||||||
try:
|
try:
|
||||||
__import__(name)
|
output_widget = __import__('calibre.gui2.convert.'+name,
|
||||||
output_widget = sys.modules[name]
|
fromlist=[1])
|
||||||
pw = output_widget.PluginWidget
|
pw = output_widget.PluginWidget
|
||||||
pw.ICON = ':/images/back.svg'
|
pw.ICON = ':/images/back.svg'
|
||||||
pw.HELP = _('Options specific to the output format.')
|
pw.HELP = _('Options specific to the output format.')
|
||||||
@ -155,7 +155,8 @@ class Config(ResizableDialog, Ui_Dialog):
|
|||||||
input_widget = None
|
input_widget = None
|
||||||
name = self.plumber.input_plugin.name.lower().replace(' ', '_')
|
name = self.plumber.input_plugin.name.lower().replace(' ', '_')
|
||||||
try:
|
try:
|
||||||
input_widget = __import__(name)
|
input_widget = __import__('calibre.gui2.convert.'+name,
|
||||||
|
fromlist=[1])
|
||||||
pw = input_widget.PluginWidget
|
pw = input_widget.PluginWidget
|
||||||
pw.ICON = ':/images/forward.svg'
|
pw.ICON = ':/images/forward.svg'
|
||||||
pw.HELP = _('Options specific to the input format.')
|
pw.HELP = _('Options specific to the input format.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user