mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Port imports
This commit is contained in:
parent
6004b84c5d
commit
3b2eafc2c4
32
setup/qt5-migrate.py
Normal file
32
setup/qt5-migrate.py
Normal file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
from __future__ import (unicode_literals, division, absolute_import,
|
||||
print_function)
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
# QT5XX: Delete this file after migration is completed
|
||||
|
||||
import os
|
||||
|
||||
def all_py_files():
|
||||
base = os.path.dirname(os.path.dirname(os.path.basename(__file__)))
|
||||
for dirpath, dirname, filenames in os.walk(os.path.join(base, 'src', 'calibre')):
|
||||
for n in filenames:
|
||||
if n.endswith('.py'):
|
||||
yield os.path.join(dirpath, n)
|
||||
|
||||
def port_imports():
|
||||
for path in all_py_files():
|
||||
with open(path, 'r+b') as f:
|
||||
raw = f.read()
|
||||
nraw = raw.replace(b'from PyQt4.', b'from PyQt5.')
|
||||
if nraw != raw:
|
||||
f.seek(0), f.truncate()
|
||||
f.write(nraw)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
port_imports()
|
||||
|
@ -477,7 +477,7 @@ def detect_ncpus():
|
||||
try:
|
||||
ans = multiprocessing.cpu_count()
|
||||
except:
|
||||
from PyQt4.Qt import QThread
|
||||
from PyQt5.Qt import QThread
|
||||
ans = QThread.idealThreadCount()
|
||||
if ans < 1:
|
||||
ans = 1
|
||||
|
@ -300,6 +300,6 @@ def get_windows_user_locale_name():
|
||||
|
||||
def is_modern_webkit():
|
||||
# Check if we are using QtWebKit >= 2.3
|
||||
from PyQt4.QtWebKit import qWebKitMajorVersion
|
||||
from PyQt5.QtWebKit import qWebKitMajorVersion
|
||||
return qWebKitMajorVersion() >= 537
|
||||
|
||||
|
@ -128,7 +128,7 @@ class Plugin(object): # {{{
|
||||
True if the user clicks OK, False otherwise. The changes are
|
||||
automatically applied.
|
||||
'''
|
||||
from PyQt4.Qt import QDialog, QDialogButtonBox, QVBoxLayout, \
|
||||
from PyQt5.Qt import QDialog, QDialogButtonBox, QVBoxLayout, \
|
||||
QLabel, Qt, QLineEdit
|
||||
from calibre.gui2 import gprefs
|
||||
|
||||
@ -708,7 +708,7 @@ class ViewerPlugin(Plugin): # {{{
|
||||
it wants to make available. For example::
|
||||
|
||||
def load_fonts():
|
||||
from PyQt4.Qt import QFontDatabase
|
||||
from PyQt5.Qt import QFontDatabase
|
||||
font_data = get_resources(['myfont1.ttf', 'myfont2.ttf'])
|
||||
for raw in font_data.itervalues():
|
||||
QFontDatabase.addApplicationFontFromData(raw)
|
||||
|
@ -60,7 +60,7 @@ def get_icons(zfp, name_or_list_of_names):
|
||||
If a single path is passed in the return value will
|
||||
be A QIcon.
|
||||
'''
|
||||
from PyQt4.Qt import QIcon, QPixmap
|
||||
from PyQt5.Qt import QIcon, QPixmap
|
||||
names = name_or_list_of_names
|
||||
ans = get_resources(zfp, names)
|
||||
if isinstance(names, basestring):
|
||||
|
@ -642,7 +642,7 @@ class Cache(object):
|
||||
return
|
||||
ret = buf.getvalue()
|
||||
if as_image:
|
||||
from PyQt4.Qt import QImage
|
||||
from PyQt5.Qt import QImage
|
||||
i = QImage()
|
||||
i.loadFromData(ret)
|
||||
ret = i
|
||||
|
@ -45,7 +45,7 @@ class AppleOpenFeedback(OpenFeedback):
|
||||
self.plugin = plugin
|
||||
|
||||
def custom_dialog(self, parent):
|
||||
from PyQt4.Qt import (QDialog, QDialogButtonBox, QIcon,
|
||||
from PyQt5.Qt import (QDialog, QDialogButtonBox, QIcon,
|
||||
QLabel, QPushButton, QVBoxLayout)
|
||||
|
||||
class Dialog(QDialog):
|
||||
|
@ -41,7 +41,7 @@ class HTMLRenderer(object):
|
||||
self.exception = self.tb = None
|
||||
|
||||
def __call__(self, ok):
|
||||
from PyQt4.Qt import QImage, QPainter, QByteArray, QBuffer
|
||||
from PyQt5.Qt import QImage, QPainter, QByteArray, QBuffer
|
||||
try:
|
||||
if not ok:
|
||||
raise RuntimeError('Rendering of HTML failed.')
|
||||
@ -130,8 +130,8 @@ def render_html_svg_workaround(path_to_html, log, width=590, height=750):
|
||||
|
||||
|
||||
def render_html(path_to_html, width=590, height=750, as_xhtml=True):
|
||||
from PyQt4.QtWebKit import QWebPage
|
||||
from PyQt4.Qt import QEventLoop, QPalette, Qt, QUrl, QSize
|
||||
from PyQt5.QtWebKit import QWebPage
|
||||
from PyQt5.Qt import QEventLoop, QPalette, Qt, QUrl, QSize
|
||||
from calibre.gui2 import is_ok_to_use_qt
|
||||
if not is_ok_to_use_qt():
|
||||
return None
|
||||
|
@ -164,7 +164,7 @@ class PDFOutput(OutputFormatPlugin):
|
||||
'''
|
||||
from calibre.ebooks.oeb.base import urlnormalize
|
||||
from calibre.utils.fonts.utils import remove_embed_restriction
|
||||
from PyQt4.Qt import QFontDatabase, QByteArray, QRawFont, QFont
|
||||
from PyQt5.Qt import QFontDatabase, QByteArray, QRawFont, QFont
|
||||
|
||||
# First find all @font-face rules and remove them, adding the embedded
|
||||
# fonts to Qt
|
||||
|
@ -66,7 +66,7 @@ every time you add an HTML file to the library.\
|
||||
True if the user clicks OK, False otherwise. The changes are
|
||||
automatically applied.
|
||||
'''
|
||||
from PyQt4.Qt import (QDialog, QDialogButtonBox, QVBoxLayout,
|
||||
from PyQt5.Qt import (QDialog, QDialogButtonBox, QVBoxLayout,
|
||||
QLabel, Qt, QLineEdit, QCheckBox)
|
||||
|
||||
config_dialog = QDialog(parent)
|
||||
|
@ -7,9 +7,9 @@ __docformat__ = 'restructuredtext en'
|
||||
Render HTML tables as images.
|
||||
'''
|
||||
import os, tempfile, atexit, shutil
|
||||
from PyQt4.Qt import QUrl, QApplication, QSize, QEventLoop, \
|
||||
from PyQt5.Qt import QUrl, QApplication, QSize, QEventLoop, \
|
||||
QPainter, QImage, QObject, Qt
|
||||
from PyQt4.QtWebKit import QWebPage
|
||||
from PyQt5.QtWebKit import QWebPage
|
||||
|
||||
class HTMLTableRenderer(QObject):
|
||||
|
||||
|
@ -33,7 +33,7 @@ def self_closing_sub(match):
|
||||
def load_html(path, view, codec='utf-8', mime_type=None,
|
||||
pre_load_callback=lambda x:None, path_is_html=False,
|
||||
force_as_html=False):
|
||||
from PyQt4.Qt import QUrl, QByteArray
|
||||
from PyQt5.Qt import QUrl, QByteArray
|
||||
if mime_type is None:
|
||||
mime_type = guess_type(path)[0]
|
||||
if not mime_type:
|
||||
|
@ -41,7 +41,7 @@ class FamilyMap(dict):
|
||||
return self.pat.sub(sub, raw)
|
||||
|
||||
def read_font_fule(self, basedir, css):
|
||||
from PyQt4.Qt import QFontDatabase
|
||||
from PyQt5.Qt import QFontDatabase
|
||||
import cssutils
|
||||
cssutils.log.setLevel(logging.ERROR)
|
||||
try:
|
||||
|
@ -28,7 +28,7 @@ class CMYKImage(BaseError):
|
||||
level = WARN
|
||||
|
||||
def __call__(self, container):
|
||||
from PyQt4.Qt import QImage
|
||||
from PyQt5.Qt import QImage
|
||||
from calibre.gui2 import pixmap_to_data
|
||||
ext = container.mime_map[self.name].split('/')[-1].upper()
|
||||
if ext == 'JPG':
|
||||
|
@ -12,9 +12,9 @@ from urllib import unquote
|
||||
from collections import defaultdict
|
||||
|
||||
from cssutils import CSSParser
|
||||
from PyQt4.Qt import (pyqtProperty, QString, QEventLoop, Qt, QSize, QTimer,
|
||||
from PyQt5.Qt import (pyqtProperty, QString, QEventLoop, Qt, QSize, QTimer,
|
||||
pyqtSlot)
|
||||
from PyQt4.QtWebKit import QWebPage, QWebView
|
||||
from PyQt5.QtWebKit import QWebPage, QWebView
|
||||
|
||||
from calibre.constants import iswindows
|
||||
from calibre.ebooks.oeb.display.webview import load_html
|
||||
|
@ -9,14 +9,14 @@ __copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
|
||||
import os, re
|
||||
from urlparse import urldefrag
|
||||
from lxml import etree
|
||||
from PyQt4.QtCore import Qt
|
||||
from PyQt4.QtCore import QByteArray
|
||||
from PyQt4.QtCore import QBuffer
|
||||
from PyQt4.QtCore import QIODevice
|
||||
from PyQt4.QtGui import QColor
|
||||
from PyQt4.QtGui import QImage
|
||||
from PyQt4.QtGui import QPainter
|
||||
from PyQt4.QtSvg import QSvgRenderer
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtCore import QByteArray
|
||||
from PyQt5.QtCore import QBuffer
|
||||
from PyQt5.QtCore import QIODevice
|
||||
from PyQt5.QtGui import QColor
|
||||
from PyQt5.QtGui import QImage
|
||||
from PyQt5.QtGui import QPainter
|
||||
from PyQt5.QtSvg import QSvgRenderer
|
||||
from calibre.ebooks.oeb.base import XHTML, XLINK
|
||||
from calibre.ebooks.oeb.base import SVG_MIME, PNG_MIME
|
||||
from calibre.ebooks.oeb.base import xml2str, xpath
|
||||
|
@ -56,7 +56,7 @@ class RescaleImages(object):
|
||||
# We cannot do an imagemagick conversion of CMYK to RGB as
|
||||
# ImageMagick inverts colors if you just set the colorspace
|
||||
# to rgb. See for example: https://bugs.launchpad.net/bugs/1246710
|
||||
from PyQt4.Qt import QImage
|
||||
from PyQt5.Qt import QImage
|
||||
from calibre.gui2 import pixmap_to_data
|
||||
qimg = QImage()
|
||||
qimg.loadFromData(raw)
|
||||
|
@ -3,7 +3,7 @@ __license__ = 'GPL 3'
|
||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import QPrinter
|
||||
from PyQt5.Qt import QPrinter
|
||||
|
||||
UNITS = {
|
||||
'millimeter' : QPrinter.Millimeter,
|
||||
|
@ -13,7 +13,7 @@ from functools import wraps, partial
|
||||
from future_builtins import map
|
||||
|
||||
import sip
|
||||
from PyQt4.Qt import (QPaintEngine, QPaintDevice, Qt, QTransform, QBrush)
|
||||
from PyQt5.Qt import (QPaintEngine, QPaintDevice, Qt, QTransform, QBrush)
|
||||
|
||||
from calibre.constants import plugins
|
||||
from calibre.ebooks.pdf.render.serialize import (PDFStream, Path)
|
||||
|
@ -12,9 +12,9 @@ from future_builtins import map
|
||||
from math import floor
|
||||
from collections import defaultdict
|
||||
|
||||
from PyQt4.Qt import (QObject, QPainter, Qt, QSize, QString, QTimer,
|
||||
from PyQt5.Qt import (QObject, QPainter, Qt, QSize, QString, QTimer,
|
||||
pyqtProperty, QEventLoop, QPixmap, QRect, pyqtSlot)
|
||||
from PyQt4.QtWebKit import QWebView, QWebPage, QWebSettings
|
||||
from PyQt5.QtWebKit import QWebView, QWebPage, QWebSettings
|
||||
|
||||
from calibre import fit_image
|
||||
from calibre.constants import iswindows
|
||||
|
@ -12,7 +12,7 @@ from future_builtins import map
|
||||
from collections import namedtuple
|
||||
|
||||
import sip
|
||||
from PyQt4.Qt import QLinearGradient, QPointF
|
||||
from PyQt5.Qt import QLinearGradient, QPointF
|
||||
|
||||
from calibre.ebooks.pdf.render.common import Name, Array, Dictionary
|
||||
|
||||
|
@ -10,7 +10,7 @@ __docformat__ = 'restructuredtext en'
|
||||
from math import sqrt
|
||||
from collections import namedtuple
|
||||
|
||||
from PyQt4.Qt import (
|
||||
from PyQt5.Qt import (
|
||||
QBrush, QPen, Qt, QPointF, QTransform, QPaintEngine, QImage)
|
||||
|
||||
from calibre.ebooks.pdf.render.common import (
|
||||
|
@ -10,7 +10,7 @@ __docformat__ = 'restructuredtext en'
|
||||
import hashlib
|
||||
from future_builtins import map
|
||||
|
||||
from PyQt4.Qt import QBuffer, QByteArray, QImage, Qt, QColor, qRgba, QPainter
|
||||
from PyQt5.Qt import QBuffer, QByteArray, QImage, Qt, QColor, qRgba, QPainter
|
||||
|
||||
from calibre.constants import (__appname__, __version__)
|
||||
from calibre.ebooks.pdf.render.common import (
|
||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import os
|
||||
|
||||
from PyQt4.Qt import (QBrush, QColor, QPoint, QPixmap, QPainterPath, QRectF,
|
||||
from PyQt5.Qt import (QBrush, QColor, QPoint, QPixmap, QPainterPath, QRectF,
|
||||
QApplication, QPainter, Qt, QImage, QLinearGradient,
|
||||
QPointF, QPen)
|
||||
QBrush, QColor, QPoint, QPixmap, QPainterPath, QRectF, Qt, QPointF
|
||||
|
@ -10,9 +10,9 @@ Write content to PDF.
|
||||
|
||||
import os, shutil, json
|
||||
|
||||
from PyQt4.Qt import (QEventLoop, QObject, QPrinter, QSizeF, Qt, QPainter,
|
||||
from PyQt5.Qt import (QEventLoop, QObject, QPrinter, QSizeF, Qt, QPainter,
|
||||
QPixmap, QTimer, pyqtProperty, QString, QSize)
|
||||
from PyQt4.QtWebKit import QWebView, QWebPage, QWebSettings
|
||||
from PyQt5.QtWebKit import QWebView, QWebPage, QWebSettings
|
||||
|
||||
from calibre.ptempfile import PersistentTemporaryDirectory
|
||||
from calibre.ebooks.pdf.pageoptions import (unit, paper_size)
|
||||
|
@ -996,7 +996,7 @@ class Application(QApplication):
|
||||
if st is not None:
|
||||
st = unicode(st.objectName()).lower()
|
||||
if (islinux or isbsd) and st in ('windows', 'motif', 'cde'):
|
||||
from PyQt4.Qt import QStyleFactory
|
||||
from PyQt5.Qt import QStyleFactory
|
||||
styles = set(map(unicode, QStyleFactory.keys()))
|
||||
if os.environ.get('KDE_FULL_SESSION', False):
|
||||
self.load_calibre_style()
|
||||
@ -1104,7 +1104,7 @@ def elided_text(text, font=None, width=300, pos='middle'):
|
||||
rendered, replacing characters from the left, middle or right (as per pos)
|
||||
of the string with an ellipsis. Results in a string much closer to the
|
||||
limit than Qt's elidedText().'''
|
||||
from PyQt4.Qt import QFontMetrics, QApplication
|
||||
from PyQt5.Qt import QFontMetrics, QApplication
|
||||
fm = QApplication.fontMetrics() if font is None else QFontMetrics(font)
|
||||
delta = 4
|
||||
ellipsis = u'\u2026'
|
||||
|
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
from functools import partial
|
||||
from zipfile import ZipFile
|
||||
|
||||
from PyQt4.Qt import (QToolButton, QAction, QIcon, QObject, QMenu,
|
||||
from PyQt5.Qt import (QToolButton, QAction, QIcon, QObject, QMenu,
|
||||
QKeySequence)
|
||||
|
||||
from calibre import prints
|
||||
|
@ -9,7 +9,7 @@ import os
|
||||
from functools import partial
|
||||
from collections import defaultdict
|
||||
|
||||
from PyQt4.Qt import QPixmap, QTimer
|
||||
from PyQt5.Qt import QPixmap, QTimer
|
||||
|
||||
from calibre import as_unicode
|
||||
from calibre.gui2 import (error_dialog, choose_files, choose_dir,
|
||||
|
@ -6,7 +6,7 @@ __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
|
||||
from PyQt4.Qt import pyqtSignal, QModelIndex, QThread, Qt
|
||||
from PyQt5.Qt import pyqtSignal, QModelIndex, QThread, Qt
|
||||
|
||||
from calibre.gui2 import error_dialog
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import re, os, shutil, errno
|
||||
|
||||
from PyQt4.Qt import QModelIndex
|
||||
from PyQt5.Qt import QModelIndex
|
||||
|
||||
from calibre.gui2 import choose_dir, error_dialog, warning_dialog
|
||||
from calibre.gui2.tools import generate_catalog
|
||||
|
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
import os, posixpath, weakref
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import (QMenu, Qt, QInputDialog, QToolButton, QDialog,
|
||||
from PyQt5.Qt import (QMenu, Qt, QInputDialog, QToolButton, QDialog,
|
||||
QDialogButtonBox, QGridLayout, QLabel, QLineEdit, QIcon, QSize,
|
||||
QCoreApplication, pyqtSignal, QVBoxLayout, QTimer)
|
||||
|
||||
@ -535,7 +535,7 @@ class ChooseLibraryAction(InterfaceAction):
|
||||
|
||||
# from calibre.utils.mem import memory
|
||||
# import weakref
|
||||
# from PyQt4.Qt import QTimer
|
||||
# from PyQt5.Qt import QTimer
|
||||
# self.dbref = weakref.ref(self.gui.library_view.model().db)
|
||||
# self.before_mem = memory()
|
||||
self.gui.library_moved(loc, allow_rebuild=True)
|
||||
|
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
import os
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import QModelIndex, QTimer
|
||||
from PyQt5.Qt import QModelIndex, QTimer
|
||||
|
||||
from calibre.gui2 import error_dialog, Dispatcher
|
||||
from calibre.gui2.tools import convert_single_ebook, convert_bulk_ebook
|
||||
|
@ -11,7 +11,7 @@ from threading import Thread
|
||||
from contextlib import closing
|
||||
from collections import defaultdict
|
||||
|
||||
from PyQt4.Qt import (
|
||||
from PyQt5.Qt import (
|
||||
QToolButton, QDialog, QGridLayout, QIcon, QLabel, QDialogButtonBox, QApplication,
|
||||
QFormLayout, QCheckBox, QWidget, QScrollArea, QVBoxLayout, Qt, QListWidgetItem, QListWidget)
|
||||
|
||||
|
@ -9,7 +9,7 @@ import errno
|
||||
from functools import partial
|
||||
from collections import Counter
|
||||
|
||||
from PyQt4.Qt import QObject, QTimer, QModelIndex
|
||||
from PyQt5.Qt import QObject, QTimer, QModelIndex
|
||||
|
||||
from calibre.gui2 import error_dialog, question_dialog
|
||||
from calibre.gui2.dialogs.delete_matching_from_device import DeleteMatchingFromDeviceDialog
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import QToolButton, QMenu, pyqtSignal, QIcon, QTimer
|
||||
from PyQt5.Qt import QToolButton, QMenu, pyqtSignal, QIcon, QTimer
|
||||
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
from calibre.utils.smtp import config as email_config
|
||||
|
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
import os, shutil, copy
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import QMenu, QModelIndex, QTimer, QIcon
|
||||
from PyQt5.Qt import QMenu, QModelIndex, QTimer, QIcon
|
||||
|
||||
from calibre.gui2 import error_dialog, Dispatcher, question_dialog, gprefs
|
||||
from calibre.gui2.dialogs.metadata_bulk import MetadataBulkDialog
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import gc
|
||||
|
||||
from PyQt4.Qt import Qt
|
||||
from PyQt5.Qt import Qt
|
||||
|
||||
from calibre.gui2 import Dispatcher
|
||||
from calibre.gui2.tools import fetch_scheduled_recipe
|
||||
|
@ -5,7 +5,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import QUrl
|
||||
from PyQt5.Qt import QUrl
|
||||
|
||||
from calibre.gui2 import open_url
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
|
@ -8,7 +8,7 @@ __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import QTimer, QApplication, Qt
|
||||
from PyQt5.Qt import QTimer, QApplication, Qt
|
||||
|
||||
from calibre.gui2 import error_dialog
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
|
@ -7,7 +7,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2011, Grant Drake <grant.drake@gmail.com>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import QApplication, Qt, QIcon
|
||||
from PyQt5.Qt import QApplication, Qt, QIcon
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog,
|
||||
FILTER_ALL, FILTER_UPDATE_AVAILABLE)
|
||||
|
@ -12,7 +12,7 @@ from collections import OrderedDict
|
||||
from functools import partial
|
||||
from future_builtins import map
|
||||
|
||||
from PyQt4.Qt import (QDialog, QGridLayout, QIcon, QCheckBox, QLabel, QFrame,
|
||||
from PyQt5.Qt import (QDialog, QGridLayout, QIcon, QCheckBox, QLabel, QFrame,
|
||||
QApplication, QDialogButtonBox, Qt, QSize, QSpacerItem,
|
||||
QSizePolicy, QTimer, QModelIndex, QTextEdit,
|
||||
QInputDialog, QMenu)
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import QIcon, Qt
|
||||
from PyQt5.Qt import QIcon, Qt
|
||||
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
from calibre.gui2.preferences.main import Preferences
|
||||
|
@ -5,7 +5,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import Qt
|
||||
from PyQt5.Qt import Qt
|
||||
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
from calibre.gui2.dialogs.book_info import BookInfo
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import QToolButton
|
||||
from PyQt5.Qt import QToolButton
|
||||
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
|
||||
|
@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import,
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
from PyQt4.Qt import QToolButton, QAction, pyqtSignal, QIcon
|
||||
from PyQt5.Qt import QToolButton, QAction, pyqtSignal, QIcon
|
||||
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
from calibre.utils.icu import sort_key
|
||||
|
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import QIcon, QSize
|
||||
from PyQt5.Qt import QIcon, QSize
|
||||
|
||||
from calibre.gui2 import error_dialog
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
from PyQt4.Qt import (QTimer, QDialog, QGridLayout, QCheckBox, QLabel,
|
||||
from PyQt5.Qt import (QTimer, QDialog, QGridLayout, QCheckBox, QLabel,
|
||||
QDialogButtonBox, QIcon)
|
||||
|
||||
from calibre.gui2 import error_dialog
|
||||
|
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
import time
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import QTimer, QDialog, QDialogButtonBox, QCheckBox, QVBoxLayout, QLabel, Qt
|
||||
from PyQt5.Qt import QTimer, QDialog, QDialogButtonBox, QCheckBox, QVBoxLayout, QLabel, Qt
|
||||
|
||||
from calibre.gui2 import error_dialog
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import os, weakref, shutil
|
||||
|
||||
from PyQt4.Qt import (QDialog, QVBoxLayout, QHBoxLayout, QRadioButton, QFrame,
|
||||
from PyQt5.Qt import (QDialog, QVBoxLayout, QHBoxLayout, QRadioButton, QFrame,
|
||||
QPushButton, QLabel, QGroupBox, QGridLayout, QIcon, QSize, QTimer)
|
||||
|
||||
from calibre import as_unicode
|
||||
|
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
import os, time
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import Qt, QAction, pyqtSignal
|
||||
from PyQt5.Qt import Qt, QAction, pyqtSignal
|
||||
|
||||
from calibre.constants import isosx, iswindows
|
||||
from calibre.gui2 import (
|
||||
|
@ -5,7 +5,7 @@ import os, shutil, time
|
||||
from Queue import Queue, Empty
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import QThread, QObject, Qt, QProgressDialog, pyqtSignal, QTimer
|
||||
from PyQt5.Qt import QThread, QObject, Qt, QProgressDialog, pyqtSignal, QTimer
|
||||
|
||||
from calibre.ptempfile import PersistentTemporaryDirectory
|
||||
from calibre.gui2.dialogs.progress import ProgressDialog
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import os
|
||||
|
||||
from PyQt4.Qt import QWizard, QWizardPage, QIcon, QPixmap, Qt, QThread, \
|
||||
from PyQt5.Qt import QWizard, QWizardPage, QIcon, QPixmap, Qt, QThread, \
|
||||
pyqtSignal
|
||||
|
||||
from calibre.gui2 import error_dialog, choose_dir, gprefs
|
||||
@ -163,7 +163,7 @@ class Wizard(QWizard): # {{{
|
||||
|
||||
# Test Wizard {{{
|
||||
if __name__ == '__main__':
|
||||
from PyQt4.Qt import QApplication
|
||||
from PyQt5.Qt import QApplication
|
||||
from calibre.library import db
|
||||
app = QApplication([])
|
||||
w = Wizard(db())
|
||||
|
@ -10,7 +10,7 @@ __docformat__ = 'restructuredtext en'
|
||||
import os, tempfile, shutil, time
|
||||
from threading import Thread, Event
|
||||
|
||||
from PyQt4.Qt import (QFileSystemWatcher, QObject, Qt, pyqtSignal, QTimer)
|
||||
from PyQt5.Qt import (QFileSystemWatcher, QObject, Qt, pyqtSignal, QTimer)
|
||||
|
||||
from calibre import prints
|
||||
from calibre.ptempfile import PersistentTemporaryDirectory
|
||||
|
@ -8,7 +8,7 @@ __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
|
||||
from PyQt4.Qt import (Qt, QAction, QMenu, QMenuBar, QObject,
|
||||
from PyQt5.Qt import (Qt, QAction, QMenu, QMenuBar, QObject,
|
||||
QToolBar, QToolButton, QSize)
|
||||
|
||||
from calibre.gui2.throbber import create_donate_widget
|
||||
|
@ -7,11 +7,11 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
from binascii import unhexlify
|
||||
|
||||
from PyQt4.Qt import (QPixmap, QSize, QWidget, Qt, pyqtSignal, QUrl, QIcon,
|
||||
from PyQt5.Qt import (QPixmap, QSize, QWidget, Qt, pyqtSignal, QUrl, QIcon,
|
||||
QPropertyAnimation, QEasingCurve, QApplication, QFontInfo, QAction,
|
||||
QSizePolicy, QPainter, QRect, pyqtProperty, QLayout, QPalette, QMenu,
|
||||
QPen, QColor)
|
||||
from PyQt4.QtWebKit import QWebView
|
||||
from PyQt5.QtWebKit import QWebView
|
||||
|
||||
from calibre import fit_image
|
||||
from calibre.gui2.dnd import (dnd_has_image, dnd_get_image, dnd_get_files,
|
||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
from calibre.gui2 import gprefs
|
||||
from calibre.gui2.catalog.catalog_bibtex_ui import Ui_Form
|
||||
from PyQt4.Qt import QWidget, QListWidgetItem
|
||||
from PyQt5.Qt import QWidget, QListWidgetItem
|
||||
|
||||
class PluginWidget(QWidget, Ui_Form):
|
||||
|
||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
||||
from calibre.gui2 import gprefs
|
||||
from calibre.gui2.catalog.catalog_csv_xml_ui import Ui_Form
|
||||
from calibre.library import db as db_
|
||||
from PyQt4.Qt import QWidget, QListWidgetItem
|
||||
from PyQt5.Qt import QWidget, QListWidgetItem
|
||||
|
||||
class PluginWidget(QWidget, Ui_Form):
|
||||
|
||||
|
@ -16,7 +16,7 @@ from calibre.utils.config import JSONConfig
|
||||
from calibre.utils.icu import sort_key
|
||||
|
||||
from catalog_epub_mobi_ui import Ui_Form
|
||||
from PyQt4.Qt import (Qt, QAbstractItemView, QCheckBox, QComboBox,
|
||||
from PyQt5.Qt import (Qt, QAbstractItemView, QCheckBox, QComboBox,
|
||||
QDoubleSpinBox, QIcon, QInputDialog, QLineEdit, QRadioButton,
|
||||
QSize, QSizePolicy, QTableWidget, QTableWidgetItem, QTextEdit, QToolButton,
|
||||
QUrl, QVBoxLayout, QWidget)
|
||||
|
@ -10,12 +10,12 @@ import re, os, json, weakref
|
||||
from lxml import html
|
||||
import sip
|
||||
|
||||
from PyQt4.Qt import (QApplication, QFontInfo, QSize, QWidget, QPlainTextEdit,
|
||||
from PyQt5.Qt import (QApplication, QFontInfo, QSize, QWidget, QPlainTextEdit,
|
||||
QToolBar, QVBoxLayout, QAction, QIcon, Qt, QTabWidget, QUrl, QFormLayout,
|
||||
QSyntaxHighlighter, QColor, QChar, QColorDialog, QMenu, QDialog, QLabel,
|
||||
QHBoxLayout, QKeySequence, QLineEdit, QDialogButtonBox, QPushButton,
|
||||
QCheckBox)
|
||||
from PyQt4.QtWebKit import QWebView, QWebPage
|
||||
from PyQt5.QtWebKit import QWebView, QWebPage
|
||||
|
||||
from calibre.ebooks.chardet import xml_to_unicode
|
||||
from calibre import xml_replace_entities, prepare_string_for_xml
|
||||
|
@ -10,7 +10,7 @@ WARNING: The code in this module is deprecated. Use complete2.py instead. This
|
||||
code remains here for legacy plugin support.
|
||||
'''
|
||||
|
||||
from PyQt4.Qt import (QLineEdit, QAbstractListModel, Qt,
|
||||
from PyQt5.Qt import (QLineEdit, QAbstractListModel, Qt,
|
||||
QApplication, QCompleter)
|
||||
|
||||
from calibre.utils.icu import sort_key
|
||||
@ -199,7 +199,7 @@ class MultiCompleteComboBox(EnComboBox):
|
||||
le.selectAll()
|
||||
|
||||
if __name__ == '__main__':
|
||||
from PyQt4.Qt import QDialog, QVBoxLayout
|
||||
from PyQt5.Qt import QDialog, QVBoxLayout
|
||||
app = QApplication([])
|
||||
d = QDialog()
|
||||
d.setLayout(QVBoxLayout())
|
||||
|
@ -10,7 +10,7 @@ __docformat__ = 'restructuredtext en'
|
||||
import weakref
|
||||
|
||||
import sip
|
||||
from PyQt4.Qt import (QLineEdit, QAbstractListModel, Qt, pyqtSignal, QObject,
|
||||
from PyQt5.Qt import (QLineEdit, QAbstractListModel, Qt, pyqtSignal, QObject,
|
||||
QApplication, QListView, QPoint, QModelIndex, QFont, QFontInfo)
|
||||
|
||||
from calibre.constants import isosx, get_osx_version
|
||||
@ -468,7 +468,7 @@ class EditWithComplete(EnComboBox):
|
||||
return EnComboBox.eventFilter(self, obj, e)
|
||||
|
||||
if __name__ == '__main__':
|
||||
from PyQt4.Qt import QDialog, QVBoxLayout
|
||||
from PyQt5.Qt import QDialog, QVBoxLayout
|
||||
app = QApplication([])
|
||||
d = QDialog()
|
||||
d.setLayout(QVBoxLayout())
|
||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
||||
import textwrap, codecs, importlib
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import (QWidget, QSpinBox, QDoubleSpinBox, QLineEdit, QTextEdit,
|
||||
from PyQt5.Qt import (QWidget, QSpinBox, QDoubleSpinBox, QLineEdit, QTextEdit,
|
||||
QCheckBox, QComboBox, Qt, QIcon, pyqtSignal, QLabel, QFontComboBox, QFont,
|
||||
QFontInfo)
|
||||
|
||||
|
@ -6,7 +6,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import shutil
|
||||
|
||||
from PyQt4.Qt import QString, QModelIndex
|
||||
from PyQt5.Qt import QString, QModelIndex
|
||||
|
||||
from calibre.gui2.convert.single import (Config, sort_formats_by_preference,
|
||||
GroupModel, gprefs, get_output_formats)
|
||||
|
@ -6,7 +6,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import QDialog
|
||||
from PyQt5.Qt import QDialog
|
||||
|
||||
from calibre.gui2.convert.font_key_ui import Ui_Dialog
|
||||
|
||||
|
@ -4,7 +4,7 @@ __license__ = 'GPL 3'
|
||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import Qt
|
||||
from PyQt5.Qt import Qt
|
||||
|
||||
from calibre.gui2 import gprefs
|
||||
from calibre.gui2.convert.heuristics_ui import Ui_Form
|
||||
|
@ -6,7 +6,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import QVariant, Qt
|
||||
from PyQt5.Qt import QVariant, Qt
|
||||
|
||||
from calibre.gui2.convert.look_and_feel_ui import Ui_Form
|
||||
from calibre.gui2.convert import Widget
|
||||
|
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import os, re
|
||||
|
||||
from PyQt4.Qt import QPixmap
|
||||
from PyQt5.Qt import QPixmap
|
||||
|
||||
from calibre.gui2 import choose_images, error_dialog
|
||||
from calibre.gui2.convert.metadata_ui import Ui_Form
|
||||
|
@ -6,7 +6,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import Qt, QAbstractListModel, QVariant, QModelIndex
|
||||
from PyQt5.Qt import Qt, QAbstractListModel, QVariant, QModelIndex
|
||||
|
||||
from calibre.gui2.convert.page_setup_ui import Ui_Form
|
||||
from calibre.gui2.convert import Widget
|
||||
|
@ -6,7 +6,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import re, os
|
||||
|
||||
from PyQt4.Qt import (QDialog, QWidget, QDialogButtonBox,
|
||||
from PyQt5.Qt import (QDialog, QWidget, QDialogButtonBox,
|
||||
QBrush, QTextCursor, QTextEdit, QByteArray, Qt, pyqtSignal)
|
||||
|
||||
from calibre.gui2.convert.regex_builder_ui import Ui_RegexBuilder
|
||||
|
@ -6,7 +6,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import re, codecs, json
|
||||
|
||||
from PyQt4.Qt import Qt, QTableWidgetItem
|
||||
from PyQt5.Qt import Qt, QTableWidgetItem
|
||||
|
||||
from calibre.gui2.convert.search_and_replace_ui import Ui_Form
|
||||
from calibre.gui2.convert import Widget
|
||||
|
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import cPickle, shutil
|
||||
|
||||
from PyQt4.Qt import QString, QAbstractListModel, Qt, QVariant, QFont, QModelIndex
|
||||
from PyQt5.Qt import QString, QAbstractListModel, Qt, QVariant, QFont, QModelIndex
|
||||
|
||||
from calibre.gui2 import ResizableDialog, NONE, gprefs
|
||||
from calibre.ebooks.conversion.config import (GuiRecommendations, save_specifics,
|
||||
|
@ -4,7 +4,7 @@ __license__ = 'GPL 3'
|
||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import QListWidgetItem, Qt
|
||||
from PyQt5.Qt import QListWidgetItem, Qt
|
||||
|
||||
from calibre.gui2.convert.txt_input_ui import Ui_Form
|
||||
from calibre.gui2.convert import Widget
|
||||
|
@ -6,7 +6,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import QDialog, QWidget, Qt, QDialogButtonBox, QVBoxLayout
|
||||
from PyQt5.Qt import QDialog, QWidget, Qt, QDialogButtonBox, QVBoxLayout
|
||||
|
||||
from calibre.gui2.convert.xpath_wizard_ui import Ui_Form
|
||||
from calibre.gui2.convert.xexp_edit_ui import Ui_Form as Ui_Edit
|
||||
@ -100,7 +100,7 @@ class XPathEdit(QWidget, Ui_Edit):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from PyQt4.Qt import QApplication
|
||||
from PyQt5.Qt import QApplication
|
||||
app = QApplication([])
|
||||
w = XPathEdit()
|
||||
w.setObjectName('test')
|
||||
|
@ -9,7 +9,7 @@ Module to implement the Cover Flow feature
|
||||
|
||||
import sys, os, time
|
||||
|
||||
from PyQt4.Qt import (QImage, QSizePolicy, QTimer, QDialog, Qt, QSize, QAction,
|
||||
from PyQt5.Qt import (QImage, QSizePolicy, QTimer, QDialog, Qt, QSize, QAction,
|
||||
QStackedLayout, QLabel, QByteArray, pyqtSignal, QKeySequence, QFont)
|
||||
|
||||
from calibre import plugins
|
||||
@ -353,7 +353,7 @@ class CoverFlowMixin(object):
|
||||
self.cf_last_updated_at = time.time()
|
||||
|
||||
def test():
|
||||
from PyQt4.QtGui import QApplication, QMainWindow
|
||||
from PyQt5.QtGui import QApplication, QMainWindow
|
||||
app = QApplication([])
|
||||
w = QMainWindow()
|
||||
cf = CoverFlow()
|
||||
@ -372,7 +372,7 @@ def main(args=sys.argv):
|
||||
return 0
|
||||
|
||||
if __name__ == '__main__':
|
||||
from PyQt4.QtGui import QApplication, QMainWindow
|
||||
from PyQt5.QtGui import QApplication, QMainWindow
|
||||
app = QApplication([])
|
||||
w = QMainWindow()
|
||||
cf = CoverFlow()
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
from functools import partial
|
||||
|
||||
from PyQt4.Qt import (QComboBox, QLabel, QSpinBox, QDoubleSpinBox, QDateTimeEdit,
|
||||
from PyQt5.Qt import (QComboBox, QLabel, QSpinBox, QDoubleSpinBox, QDateTimeEdit,
|
||||
QDateTime, QGroupBox, QVBoxLayout, QSizePolicy, QGridLayout,
|
||||
QSpacerItem, QIcon, QCheckBox, QWidget, QHBoxLayout,
|
||||
QPushButton, QMessageBox, QToolButton, Qt)
|
||||
|
@ -6,7 +6,7 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
import os, traceback, Queue, time, cStringIO, re, sys, weakref
|
||||
from threading import Thread, Event
|
||||
|
||||
from PyQt4.Qt import (
|
||||
from PyQt5.Qt import (
|
||||
QMenu, QAction, QActionGroup, QIcon, Qt, pyqtSignal, QDialog,
|
||||
QObject, QVBoxLayout, QDialogButtonBox, QCursor, QCoreApplication,
|
||||
QApplication, QEventLoop)
|
||||
|
@ -6,7 +6,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import textwrap
|
||||
|
||||
from PyQt4.Qt import (QWidget, QListWidgetItem, Qt, QVariant, QLabel,
|
||||
from PyQt5.Qt import (QWidget, QListWidgetItem, Qt, QVariant, QLabel,
|
||||
QLineEdit, QCheckBox, QComboBox)
|
||||
|
||||
from calibre.gui2 import error_dialog, question_dialog
|
||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import weakref
|
||||
|
||||
from PyQt4.Qt import (QWidget, QListWidgetItem, Qt, QToolButton, QLabel,
|
||||
from PyQt5.Qt import (QWidget, QListWidgetItem, Qt, QToolButton, QLabel,
|
||||
QTabWidget, QGridLayout, QListWidget, QIcon, QLineEdit, QVBoxLayout,
|
||||
QPushButton, QGroupBox, QScrollArea, QHBoxLayout, QComboBox,
|
||||
pyqtSignal, QSizePolicy, QDialog, QDialogButtonBox, QPlainTextEdit,
|
||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
from operator import attrgetter
|
||||
|
||||
from PyQt4.Qt import (QTabWidget, QTreeWidget, QTreeWidgetItem, Qt, QDialog,
|
||||
from PyQt5.Qt import (QTabWidget, QTreeWidget, QTreeWidgetItem, Qt, QDialog,
|
||||
QDialogButtonBox, QVBoxLayout, QSize, pyqtSignal, QIcon, QLabel)
|
||||
|
||||
from calibre.gui2 import file_icon_provider
|
||||
|
@ -4,7 +4,7 @@ __docformat__ = 'restructuredtext en'
|
||||
__license__ = 'GPL v3'
|
||||
|
||||
|
||||
from PyQt4.Qt import QDialog, QGridLayout, QLabel, QDialogButtonBox, \
|
||||
from PyQt5.Qt import QDialog, QGridLayout, QLabel, QDialogButtonBox, \
|
||||
QApplication, QSpinBox, QToolButton, QIcon, QCheckBox
|
||||
from calibre.ebooks.metadata import string_to_authors
|
||||
from calibre.gui2.complete2 import EditWithComplete
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import os
|
||||
|
||||
from PyQt4.Qt import QDialog, QApplication
|
||||
from PyQt5.Qt import QDialog, QApplication
|
||||
|
||||
from calibre.gui2.dialogs.add_from_isbn_ui import Ui_Dialog
|
||||
from calibre.ebooks.metadata import check_isbn
|
||||
|
@ -8,7 +8,7 @@ __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
from PyQt4.Qt import (
|
||||
from PyQt5.Qt import (
|
||||
QDialog, QGridLayout, QDialogButtonBox, QListWidget, QApplication, Qt,
|
||||
pyqtSignal, QSize, QPushButton, QIcon, QStyledItemDelegate, QLabel)
|
||||
|
||||
|
@ -6,11 +6,11 @@ __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
|
||||
from PyQt4.Qt import (
|
||||
from PyQt5.Qt import (
|
||||
QCoreApplication, QModelIndex, QTimer, Qt, pyqtSignal, QWidget,
|
||||
QGridLayout, QDialog, QPixmap, QSize, QPalette, QShortcut, QKeySequence,
|
||||
QSplitter, QVBoxLayout, QCheckBox, QPushButton, QIcon, QBrush)
|
||||
from PyQt4.QtWebKit import QWebView
|
||||
from PyQt5.QtWebKit import QWebView
|
||||
|
||||
from calibre.gui2 import gprefs
|
||||
from calibre import fit_image
|
||||
|
@ -19,7 +19,7 @@ class Catalog(ResizableDialog, Ui_Dialog):
|
||||
def __init__(self, parent, dbspec, ids, db):
|
||||
import re, cStringIO
|
||||
from calibre import prints as info
|
||||
from PyQt4.uic import compileUi
|
||||
from PyQt5.uic import compileUi
|
||||
|
||||
ResizableDialog.__init__(self, parent)
|
||||
self.dbspec, self.ids = dbspec, ids
|
||||
@ -186,7 +186,7 @@ class Catalog(ResizableDialog, Ui_Dialog):
|
||||
To add help functionality for a specific format:
|
||||
In gui2.catalog.catalog_<format>.py, add the following:
|
||||
from calibre.gui2 import open_url
|
||||
from PyQt4.Qt import QUrl
|
||||
from PyQt5.Qt import QUrl
|
||||
|
||||
In the PluginWidget() class, add this method:
|
||||
def show_help(self):
|
||||
|
@ -6,7 +6,7 @@ __license__ = 'GPL v3'
|
||||
import os
|
||||
from threading import Thread
|
||||
|
||||
from PyQt4.Qt import (
|
||||
from PyQt5.Qt import (
|
||||
QDialog, QVBoxLayout, QHBoxLayout, QTreeWidget, QLabel, QPushButton,
|
||||
QDialogButtonBox, QApplication, QTreeWidgetItem, QLineEdit, Qt, QSize,
|
||||
QTimer, QIcon, QTextEdit, QSplitter, QWidget, QGridLayout, pyqtSignal)
|
||||
|
@ -1,7 +1,7 @@
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
from PyQt4.Qt import QDialog, QListWidgetItem, QModelIndex
|
||||
from PyQt5.Qt import QDialog, QListWidgetItem, QModelIndex
|
||||
|
||||
from calibre.gui2 import file_icon_provider
|
||||
from calibre.gui2.dialogs.choose_format_ui import Ui_ChooseFormatDialog
|
||||
|
@ -1,7 +1,7 @@
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||
|
||||
from PyQt4.Qt import QDialog, QTreeWidgetItem, QIcon, QModelIndex
|
||||
from PyQt5.Qt import QDialog, QTreeWidgetItem, QIcon, QModelIndex
|
||||
|
||||
from calibre.gui2 import file_icon_provider
|
||||
from calibre.gui2.dialogs.choose_format_device_ui import Ui_ChooseFormatDeviceDialog
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import os
|
||||
|
||||
from PyQt4.Qt import QDialog
|
||||
from PyQt5.Qt import QDialog
|
||||
|
||||
from calibre.gui2.dialogs.choose_library_ui import Ui_Dialog
|
||||
from calibre.gui2 import error_dialog, choose_dir
|
||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
||||
__license__ = 'GPL v3'
|
||||
|
||||
|
||||
from PyQt4.Qt import (QDialog, QVBoxLayout, QLabel, QDialogButtonBox,
|
||||
from PyQt5.Qt import (QDialog, QVBoxLayout, QLabel, QDialogButtonBox,
|
||||
QListWidget, QAbstractItemView)
|
||||
from PyQt4 import QtGui
|
||||
|
||||
|
@ -4,7 +4,7 @@ __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
''''''
|
||||
from PyQt4.QtGui import QDialog
|
||||
from PyQt5.QtGui import QDialog
|
||||
from calibre.gui2.dialogs.comicconf_ui import Ui_Dialog
|
||||
from calibre.ebooks.lrf.comic.convert_from import config, PROFILES
|
||||
|
||||
|
@ -3,7 +3,7 @@ __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
__license__ = 'GPL v3'
|
||||
|
||||
from PyQt4.Qt import Qt, QDialog, QDialogButtonBox
|
||||
from PyQt5.Qt import Qt, QDialog, QDialogButtonBox
|
||||
|
||||
from calibre.gui2 import gprefs
|
||||
from calibre.gui2.dialogs.comments_dialog_ui import Ui_CommentsDialog
|
||||
|
@ -3,7 +3,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import QDialog, Qt, QPixmap, QIcon
|
||||
from PyQt5.Qt import QDialog, Qt, QPixmap, QIcon
|
||||
|
||||
from calibre import confirm_config_name
|
||||
from calibre.gui2 import dynamic
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
from functools import partial
|
||||
|
||||
from calibre.gui2.dialogs.confirm_delete_location_ui import Ui_Dialog
|
||||
from PyQt4.Qt import QDialog, Qt, QPixmap, QIcon
|
||||
from PyQt5.Qt import QDialog, Qt, QPixmap, QIcon
|
||||
|
||||
class Dialog(QDialog, Ui_Dialog):
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
from PyQt4.QtGui import QDialog
|
||||
from PyQt5.QtGui import QDialog
|
||||
|
||||
from calibre.gui2.dialogs.conversion_error_ui import Ui_ConversionErrorDialog
|
||||
|
||||
|
@ -3,7 +3,7 @@ __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
__license__ = 'GPL v3'
|
||||
|
||||
from PyQt4.Qt import Qt, QDialog, QTableWidgetItem, QAbstractItemView
|
||||
from PyQt5.Qt import Qt, QDialog, QTableWidgetItem, QAbstractItemView
|
||||
|
||||
from calibre import strftime
|
||||
from calibre.ebooks.metadata import authors_to_string, authors_to_sort_string, \
|
||||
|
@ -1,8 +1,8 @@
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
from PyQt4.QtCore import Qt, QString
|
||||
from PyQt4.QtGui import QDialog, QListWidgetItem
|
||||
from PyQt5.QtCore import Qt, QString
|
||||
from PyQt5.QtGui import QDialog, QListWidgetItem
|
||||
|
||||
from calibre.gui2.dialogs.device_category_editor_ui import Ui_DeviceCategoryEditor
|
||||
from calibre.gui2 import question_dialog, error_dialog
|
||||
|
@ -6,7 +6,7 @@ __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
|
||||
from PyQt4.Qt import QDialog
|
||||
from PyQt5.Qt import QDialog
|
||||
from calibre.gui2.dialogs.drm_error_ui import Ui_Dialog
|
||||
|
||||
class DRMErrorMessage(QDialog, Ui_Dialog):
|
||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import os.path
|
||||
|
||||
from PyQt4.Qt import (
|
||||
from PyQt5.Qt import (
|
||||
QDialog, QGridLayout, QIcon, QLabel, QTreeWidget, QTreeWidgetItem, Qt,
|
||||
QFont, QDialogButtonBox, QApplication)
|
||||
|
||||
|
@ -3,7 +3,7 @@ __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
__license__ = 'GPL v3'
|
||||
|
||||
from PyQt4.Qt import (Qt, QDialog, QTableWidgetItem, QAbstractItemView, QIcon,
|
||||
from PyQt5.Qt import (Qt, QDialog, QTableWidgetItem, QAbstractItemView, QIcon,
|
||||
QDialogButtonBox, QFrame, QLabel, QTimer, QMenu, QApplication,
|
||||
QByteArray)
|
||||
|
||||
|
@ -8,7 +8,7 @@ __copyright__ = '2013, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
|
||||
from PyQt4.Qt import (Qt, QDialog, QAbstractItemView, QTableWidgetItem,
|
||||
from PyQt5.Qt import (Qt, QDialog, QAbstractItemView, QTableWidgetItem,
|
||||
QByteArray)
|
||||
|
||||
from calibre.gui2 import gprefs, error_dialog
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user