mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 17:56:30 +00:00
Little code cleaning
This commit is contained in:
10
kcc.py
10
kcc.py
@@ -35,12 +35,12 @@ else:
|
||||
from kcc import KCC_ui
|
||||
|
||||
freeze_support()
|
||||
app = QtGui.QApplication(sys.argv)
|
||||
APP = QtGui.QApplication(sys.argv)
|
||||
KCC = QtGui.QMainWindow()
|
||||
ui = KCC_ui.Ui_KCC()
|
||||
ui.setupUi(KCC)
|
||||
gui = KCC_gui.Ui_KCC(ui, KCC)
|
||||
UI = KCC_ui.Ui_KCC()
|
||||
UI.setupUi(KCC)
|
||||
GUI = KCC_gui.Ui_KCC(UI, KCC)
|
||||
KCC.setWindowTitle("Kindle Comic Converter " + __version__)
|
||||
KCC.show()
|
||||
KCC.raise_()
|
||||
sys.exit(app.exec_())
|
||||
sys.exit(APP.exec_())
|
||||
|
||||
@@ -145,15 +145,13 @@ class WorkerThread(QtCore.QThread):
|
||||
continue
|
||||
if not errors:
|
||||
os.remove(mobiPath + '_tostrip')
|
||||
self.emit(QtCore.SIGNAL("addMessage"), 'Removing SRCS header... Done!',
|
||||
'info', True)
|
||||
self.emit(QtCore.SIGNAL("addMessage"), 'Removing SRCS header... Done!', 'info', True)
|
||||
else:
|
||||
shutil.move(mobiPath + '_tostrip', mobiPath)
|
||||
self.emit(QtCore.SIGNAL("addMessage"),
|
||||
'KindleStrip failed to remove SRCS header!', 'warning')
|
||||
self.emit(QtCore.SIGNAL("addMessage"),
|
||||
'MOBI file will work correctly but it will be highly oversized.',
|
||||
'warning')
|
||||
'MOBI file will work correctly but it will be highly oversized.', 'warning')
|
||||
else:
|
||||
os.remove(outputPath)
|
||||
os.remove(outputPath.replace('.epub', '.mobi'))
|
||||
@@ -161,10 +159,8 @@ class WorkerThread(QtCore.QThread):
|
||||
self.emit(QtCore.SIGNAL("addMessage"), 'Try converting smaller batch.', 'error')
|
||||
else:
|
||||
os.remove(outputPath)
|
||||
self.emit(QtCore.SIGNAL("addMessage"), 'Created EPUB file is too big for KindleGen!',
|
||||
'error')
|
||||
self.emit(QtCore.SIGNAL("addMessage"), 'Try converting smaller batch.',
|
||||
'error')
|
||||
self.emit(QtCore.SIGNAL("addMessage"), 'Created EPUB file is too big for KindleGen!', 'error')
|
||||
self.emit(QtCore.SIGNAL("addMessage"), 'Try converting smaller batch.', 'error')
|
||||
self.parent.needClean = True
|
||||
self.emit(QtCore.SIGNAL("addMessage"), 'All jobs completed.', 'warning')
|
||||
self.emit(QtCore.SIGNAL("modeConvert"), True)
|
||||
@@ -347,9 +343,9 @@ class Ui_KCC(object):
|
||||
self.settings.setValue('lastDevice', GUI.DeviceBox.currentIndex())
|
||||
self.settings.sync()
|
||||
|
||||
def __init__(self, ui, KCC):
|
||||
def __init__(self, UI, KCC):
|
||||
global GUI, MainWindow
|
||||
GUI = ui
|
||||
GUI = UI
|
||||
MainWindow = KCC
|
||||
profiles = sorted(ProfileData.ProfileLabels.iterkeys())
|
||||
self.icons = Icons()
|
||||
|
||||
Reference in New Issue
Block a user