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