1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +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
from urllib.parse import unquote
from urllib.request import urlopen, urlretrieve, Request
from time import sleep, time
from datetime import datetime
from time import sleep
from shutil import move
from subprocess import STDOUT, PIPE
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 copy import copy
from distutils.version import StrictVersion
from xml.sax.saxutils import escape
from platform import platform
from raven import Client
from .shared import md5Checksum, HTMLStripper, sanitizeTrace, saferRemove
from . import __version__
@@ -528,7 +526,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
def clearJobs(self):
GUI.jobList.clear()
# noinspection PyCallByClass,PyTypeChecker,PyArgumentList
# noinspection PyCallByClass,PyTypeChecker
def openWiki(self):
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.worker.sync()
else:
# noinspection PyArgumentList
if QtWidgets.QApplication.keyboardModifiers() == QtCore.Qt.ShiftModifier:
dname = QtWidgets.QFileDialog.getExistingDirectory(MW, 'Select output directory', self.lastPath)
if dname != '':
@@ -853,7 +850,6 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
else:
self.addMessage('Download it and place executable in /usr/local/bin directory.', 'error')
# noinspection PyArgumentList
def __init__(self, KCCAplication, KCCWindow):
global APP, MW, GUI
APP = KCCAplication

View File

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

View File

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