diff options
-rw-r--r-- | kcc.py | 6 | ||||
-rw-r--r-- | kcc/KCC_gui.py | 2 | ||||
-rwxr-xr-x | kcc/comic2ebook.py | 26 | ||||
-rw-r--r-- | kcc/comic2panel.py | 4 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | setup.sh | 2 |
6 files changed, 21 insertions, 21 deletions
diff --git a/kcc.py b/kcc.py index 4ebd829..397dc0b 100644 --- a/kcc.py +++ b/kcc.py @@ -27,15 +27,15 @@ import sys import os try: # noinspection PyUnresolvedReferences - from PyQt4 import QtCore, QtGui, QtNetwork + from PyQt5 import QtCore, QtGui, QtNetwork except ImportError: - print("ERROR: PyQT4 is not installed!") + print("ERROR: PyQT5 is not installed!") if sys.platform.startswith('linux'): import tkinter import tkinter.messagebox importRoot = tkinter.Tk() importRoot.withdraw() - tkinter.messagebox.showerror("KCC - Error", "PyQT4 is not installed!") + tkinter.messagebox.showerror("KCC - Error", "PyQT5 is not installed!") exit(1) from kcc import KCC_gui from multiprocessing import freeze_support diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index 7c4b303..e6731dc 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -34,7 +34,7 @@ from shutil import move from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver import ThreadingMixIn from subprocess import STDOUT, PIPE -from PyQt4 import QtGui, QtCore +from PyQt5 import QtGui, QtCore from xml.dom.minidom import parse from html.parser import HTMLParser from .KCC_rc_web import WebContent diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index a0d8d15..6e6f91f 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -27,12 +27,11 @@ import sys import re import stat import string -import unicodedata import zipfile from tempfile import mkdtemp from shutil import move, copyfile, copytree, rmtree from optparse import OptionParser, OptionGroup -from multiprocessing import Pool, freeze_support +from multiprocessing import Pool from xml.dom.minidom import parse from uuid import uuid4 from slugify import slugify @@ -40,25 +39,25 @@ try: # noinspection PyUnresolvedReferences from PIL import Image if tuple(map(int, ('2.3.0'.split(".")))) > tuple(map(int, (Image.PILLOW_VERSION.split(".")))): - print "ERROR: Pillow 2.3.0 or newer is required!" + print("ERROR: Pillow 2.3.0 or newer is required!") if sys.platform.startswith('linux'): - import Tkinter - import tkMessageBox - importRoot = Tkinter.Tk() + import tkinter + import tkinter.messagebox + importRoot = tkinter.Tk() importRoot.withdraw() - tkMessageBox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") + tkinter.messagebox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") exit(1) except ImportError: - print "ERROR: Pillow is not installed!" + print("ERROR: Pillow is not installed!") if sys.platform.startswith('linux'): - import Tkinter - import tkMessageBox - importRoot = Tkinter.Tk() + import tkinter + import tkinter.messagebox + importRoot = tkinter.Tk() importRoot.withdraw() - tkMessageBox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") + tkinter.messagebox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") exit(1) try: - from PyQt4 import QtCore + from PyQt5 import QtCore except ImportError: QtCore = None from . import comic2panel @@ -672,6 +671,7 @@ def checkComicInfo(path, originalPath): os.remove(xmlPath) +# TODO: Check if replacement work correctly #def slugify(value): # # Normalizes string, converts to lowercase, removes non-alpha characters and converts spaces to hyphens. # value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore') diff --git a/kcc/comic2panel.py b/kcc/comic2panel.py index 2716a3b..34d9763 100644 --- a/kcc/comic2panel.py +++ b/kcc/comic2panel.py @@ -26,7 +26,7 @@ import os import sys from shutil import rmtree, copytree, move from optparse import OptionParser, OptionGroup -from multiprocessing import Pool, freeze_support +from multiprocessing import Pool try: # noinspection PyUnresolvedReferences from PIL import Image, ImageStat @@ -49,7 +49,7 @@ except ImportError: tkinter.messagebox.showerror("KCC - Error", "Pillow 2.3.0 or newer is required!") exit(1) try: - from PyQt4 import QtCore + from PyQt5 import QtCore except ImportError: QtCore = None diff --git a/setup.py b/setup.py index 1243ab2..dbea2f2 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 """ cx_Freeze build script for KCC. diff --git a/setup.sh b/setup.sh index f4382d1..fe68a57 100644 --- a/setup.sh +++ b/setup.sh @@ -5,7 +5,7 @@ VERSION="4.0" cp kcc.py __main__.py zip kcc.zip __main__.py kcc/*.py -echo "#!/usr/bin/env python2" > kcc-bin +echo "#!/usr/bin/env python3" > kcc-bin cat kcc.zip >> kcc-bin chmod +x kcc-bin tar --xform s:^.*/:: --xform s/kcc-bin/kcc/ --xform s/comic2ebook/kcc/ -czf KindleComicConverter_linux_$VERSION.tar.gz kcc-bin LICENSE.txt icons/comic2ebook.png |