mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
cleanups
This commit is contained in:
parent
03c5a395f3
commit
8f97e09d0b
@ -4,14 +4,12 @@ __license__ = 'GPL 3'
|
|||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os
|
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
from calibre.customize.conversion import OptionRecommendation, DummyReporter
|
from calibre.customize.conversion import OptionRecommendation, DummyReporter
|
||||||
from calibre.ebooks.conversion.plumber import Plumber
|
from calibre.ebooks.conversion.plumber import Plumber
|
||||||
from calibre.customize.ui import plugin_for_catalog_format
|
from calibre.customize.ui import plugin_for_catalog_format
|
||||||
from calibre.utils.logging import Log
|
from calibre.utils.logging import Log
|
||||||
from calibre.gui2 import choose_dir, Application
|
|
||||||
|
|
||||||
def gui_convert(input, output, recommendations, notification=DummyReporter(),
|
def gui_convert(input, output, recommendations, notification=DummyReporter(),
|
||||||
abort_after_input_dump=False, log=None):
|
abort_after_input_dump=False, log=None):
|
||||||
|
@ -6,15 +6,14 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os, shutil, sys, tempfile
|
import os, sys
|
||||||
|
|
||||||
from PyQt4.Qt import QDialog, QWidget
|
from PyQt4.Qt import QDialog
|
||||||
|
|
||||||
from calibre.customize.ui import config
|
from calibre.customize.ui import config
|
||||||
from calibre.gui2.dialogs.catalog_ui import Ui_Dialog
|
from calibre.gui2.dialogs.catalog_ui import Ui_Dialog
|
||||||
from calibre.gui2 import gprefs, dynamic
|
from calibre.gui2 import dynamic
|
||||||
from calibre.customize.ui import available_catalog_formats, catalog_plugins
|
from calibre.customize.ui import catalog_plugins
|
||||||
from calibre.gui2.catalog.catalog_csv_xml import PluginWidget
|
|
||||||
|
|
||||||
class Catalog(QDialog, Ui_Dialog):
|
class Catalog(QDialog, Ui_Dialog):
|
||||||
''' Catalog Dialog builder'''
|
''' Catalog Dialog builder'''
|
||||||
@ -23,7 +22,6 @@ class Catalog(QDialog, Ui_Dialog):
|
|||||||
def __init__(self, parent, dbspec, ids):
|
def __init__(self, parent, dbspec, ids):
|
||||||
import re, cStringIO
|
import re, cStringIO
|
||||||
from calibre import prints as info
|
from calibre import prints as info
|
||||||
from calibre.gui2 import dynamic
|
|
||||||
from PyQt4.uic import compileUi
|
from PyQt4.uic import compileUi
|
||||||
|
|
||||||
QDialog.__init__(self, parent)
|
QDialog.__init__(self, parent)
|
||||||
@ -45,7 +43,6 @@ class Catalog(QDialog, Ui_Dialog):
|
|||||||
self.fmts = []
|
self.fmts = []
|
||||||
|
|
||||||
from calibre.customize.builtins import plugins as builtin_plugins
|
from calibre.customize.builtins import plugins as builtin_plugins
|
||||||
from calibre.customize import CatalogPlugin
|
|
||||||
|
|
||||||
for plugin in catalog_plugins():
|
for plugin in catalog_plugins():
|
||||||
if plugin.name in config['disabled_plugins']:
|
if plugin.name in config['disabled_plugins']:
|
||||||
@ -104,7 +101,7 @@ class Catalog(QDialog, Ui_Dialog):
|
|||||||
|
|
||||||
self.widgets = sorted(self.widgets, key=lambda x:(x.TITLE, x.TITLE))
|
self.widgets = sorted(self.widgets, key=lambda x:(x.TITLE, x.TITLE))
|
||||||
for pw in self.widgets:
|
for pw in self.widgets:
|
||||||
page = self.tabs.addTab(pw,pw.TITLE)
|
self.tabs.addTab(pw,pw.TITLE)
|
||||||
|
|
||||||
# Generate a sorted list of installed catalog formats/sync_enabled pairs
|
# Generate a sorted list of installed catalog formats/sync_enabled pairs
|
||||||
fmts = sorted([x[0] for x in self.fmts])
|
fmts = sorted([x[0] for x in self.fmts])
|
||||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
'''The main GUI'''
|
'''The main GUI'''
|
||||||
|
|
||||||
import atexit, os, shutil, sys, tempfile, textwrap, collections, time
|
import os, shutil, sys, textwrap, collections, time
|
||||||
from xml.parsers.expat import ExpatError
|
from xml.parsers.expat import ExpatError
|
||||||
from Queue import Queue, Empty
|
from Queue import Queue, Empty
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
Loading…
x
Reference in New Issue
Block a user