1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-16 03:06:33 +00:00

Code cleanup

This commit is contained in:
Paweł Jastrzębski
2016-11-26 08:35:16 +01:00
parent 2e85556543
commit bdb459cfab
3 changed files with 5 additions and 12 deletions

View File

@@ -21,17 +21,15 @@ import os
import sys import sys
from urllib.parse import unquote from urllib.parse import unquote
from urllib.request import urlopen, urlretrieve, Request from urllib.request import urlopen, urlretrieve, Request
from time import sleep, time from time import sleep
from datetime import datetime
from shutil import move from shutil import move
from subprocess import STDOUT, PIPE from subprocess import STDOUT, PIPE
from PyQt5 import QtGui, QtCore, QtWidgets, QtNetwork from PyQt5 import QtGui, QtCore, QtWidgets, QtNetwork
from xml.dom.minidom import parse, Document from xml.dom.minidom import parse
from psutil import Popen, Process from psutil import Popen, Process
from copy import copy from copy import copy
from distutils.version import StrictVersion from distutils.version import StrictVersion
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
from platform import platform
from raven import Client from raven import Client
from .shared import md5Checksum, HTMLStripper, sanitizeTrace, saferRemove from .shared import md5Checksum, HTMLStripper, sanitizeTrace, saferRemove
from . import __version__ from . import __version__
@@ -528,7 +526,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
def clearJobs(self): def clearJobs(self):
GUI.jobList.clear() GUI.jobList.clear()
# noinspection PyCallByClass,PyTypeChecker,PyArgumentList # noinspection PyCallByClass,PyTypeChecker
def openWiki(self): def openWiki(self):
QtGui.QDesktopServices.openUrl(QtCore.QUrl('https://github.com/ciromattia/kcc/wiki')) QtGui.QDesktopServices.openUrl(QtCore.QUrl('https://github.com/ciromattia/kcc/wiki'))
@@ -705,7 +703,6 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
self.conversionAlive = False self.conversionAlive = False
self.worker.sync() self.worker.sync()
else: else:
# noinspection PyArgumentList
if QtWidgets.QApplication.keyboardModifiers() == QtCore.Qt.ShiftModifier: if QtWidgets.QApplication.keyboardModifiers() == QtCore.Qt.ShiftModifier:
dname = QtWidgets.QFileDialog.getExistingDirectory(MW, 'Select output directory', self.lastPath) dname = QtWidgets.QFileDialog.getExistingDirectory(MW, 'Select output directory', self.lastPath)
if dname != '': if dname != '':
@@ -853,7 +850,6 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
else: else:
self.addMessage('Download it and place executable in /usr/local/bin directory.', 'error') self.addMessage('Download it and place executable in /usr/local/bin directory.', 'error')
# noinspection PyArgumentList
def __init__(self, KCCAplication, KCCWindow): def __init__(self, KCCAplication, KCCWindow):
global APP, MW, GUI global APP, MW, GUI
APP = KCCAplication APP = KCCAplication

View File

@@ -93,7 +93,6 @@ def buildHTML(path, imgfile, imgfilepath):
additionalStyle = 'background-color:#000000;' additionalStyle = 'background-color:#000000;'
else: else:
additionalStyle = 'background-color:#FFFFFF;' additionalStyle = 'background-color:#FFFFFF;'
htmlpath = ''
postfix = '' postfix = ''
backref = 1 backref = 1
head = path head = path
@@ -1014,7 +1013,6 @@ def checkPre(source):
raise UserWarning("Target directory is not writable.") raise UserWarning("Target directory is not writable.")
# noinspection PyTypeChecker
def makeBook(source, qtGUI=None): def makeBook(source, qtGUI=None):
global GUI global GUI
GUI = qtGUI GUI = qtGUI
@@ -1029,8 +1027,8 @@ def makeBook(source, qtGUI=None):
getComicInfo(os.path.join(path, "OEBPS", "Images"), source) getComicInfo(os.path.join(path, "OEBPS", "Images"), source)
detectCorruption(os.path.join(path, "OEBPS", "Images"), source) detectCorruption(os.path.join(path, "OEBPS", "Images"), source)
if options.webtoon: if options.webtoon:
if image.ProfileData.Profiles[options.profile][1][1] > 1000: if image.ProfileData.Profiles[options.profile][1][1] > 1024:
y = 1000 y = 1024
else: else:
y = image.ProfileData.Profiles[options.profile][1][1] y = image.ProfileData.Profiles[options.profile][1][1]
comic2panel.main(['-y ' + str(y), '-i', '-m', path], qtGUI) comic2panel.main(['-y ' + str(y), '-i', '-m', path], qtGUI)

View File

@@ -61,7 +61,6 @@ class PdfJpgExtract:
iend += endfix iend += endfix
jpg = pdf[istart:iend] jpg = pdf[istart:iend]
jpgfile = open(self.path + "/jpg%d.jpg" % njpg, "wb") jpgfile = open(self.path + "/jpg%d.jpg" % njpg, "wb")
# noinspection PyTypeChecker
jpgfile.write(jpg) jpgfile.write(jpg)
jpgfile.close() jpgfile.close()
njpg += 1 njpg += 1