mirror of
https://github.com/ciromattia/kcc
synced 2025-12-21 21:51:52 +00:00
Little code cleanup
This commit is contained in:
1
kcc.py
1
kcc.py
@@ -32,7 +32,6 @@ except ImportError:
|
|||||||
exit(1)
|
exit(1)
|
||||||
from kcc import KCC_gui
|
from kcc import KCC_gui
|
||||||
from multiprocessing import freeze_support
|
from multiprocessing import freeze_support
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
os.environ['PATH'] = '/usr/local/bin:' + os.environ['PATH']
|
os.environ['PATH'] = '/usr/local/bin:' + os.environ['PATH']
|
||||||
from kcc import KCC_ui_osx as KCC_ui
|
from kcc import KCC_ui_osx as KCC_ui
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ class WorkerThread(QtCore.QThread):
|
|||||||
self.emit(QtCore.SIGNAL("addMessage"), '<b>Conversion interrupted.</b>', 'error')
|
self.emit(QtCore.SIGNAL("addMessage"), '<b>Conversion interrupted.</b>', 'error')
|
||||||
self.emit(QtCore.SIGNAL("modeConvert"), True)
|
self.emit(QtCore.SIGNAL("modeConvert"), True)
|
||||||
|
|
||||||
# noinspection PyUnboundLocalVariable
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.emit(QtCore.SIGNAL("modeConvert"), False)
|
self.emit(QtCore.SIGNAL("modeConvert"), False)
|
||||||
profile = ProfileData.ProfileLabels[str(GUI.DeviceBox.currentText())]
|
profile = ProfileData.ProfileLabels[str(GUI.DeviceBox.currentText())]
|
||||||
|
|||||||
@@ -689,6 +689,7 @@ def getDirectorySize(start_path='.'):
|
|||||||
return total_size
|
return total_size
|
||||||
|
|
||||||
|
|
||||||
|
# noinspection PyUnusedLocal
|
||||||
def createNewTome(parentPath):
|
def createNewTome(parentPath):
|
||||||
tomePathRoot = tempfile.mkdtemp('', 'KCC-TMP-')
|
tomePathRoot = tempfile.mkdtemp('', 'KCC-TMP-')
|
||||||
#tomePathRoot = tempfile.mkdtemp('', 'KCC-TMP-', parentPath)
|
#tomePathRoot = tempfile.mkdtemp('', 'KCC-TMP-', parentPath)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ from shutil import rmtree, copytree, move
|
|||||||
from optparse import OptionParser, OptionGroup
|
from optparse import OptionParser, OptionGroup
|
||||||
from multiprocessing import Pool, Queue, freeze_support
|
from multiprocessing import Pool, Queue, freeze_support
|
||||||
try:
|
try:
|
||||||
# noinspection PyUnresolvedReferences,PyPackageRequirements
|
# noinspection PyUnresolvedReferences
|
||||||
from PIL import Image, ImageStat
|
from PIL import Image, ImageStat
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print "ERROR: Pillow is not installed!"
|
print "ERROR: Pillow is not installed!"
|
||||||
@@ -137,7 +137,7 @@ def splitImage(work):
|
|||||||
filePath = os.path.join(path, name)
|
filePath = os.path.join(path, name)
|
||||||
# Detect corrupted files
|
# Detect corrupted files
|
||||||
try:
|
try:
|
||||||
image = Image.open(filePath)
|
Image.open(filePath)
|
||||||
except IOError:
|
except IOError:
|
||||||
raise RuntimeError('Cannot read image file %s' % filePath)
|
raise RuntimeError('Cannot read image file %s' % filePath)
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
try:
|
try:
|
||||||
# noinspection PyUnresolvedReferences,PyPackageRequirements
|
# noinspection PyUnresolvedReferences
|
||||||
from PIL import Image, ImageOps, ImageStat, ImageChops
|
from PIL import Image, ImageOps, ImageStat, ImageChops
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print "ERROR: Pillow is not installed!"
|
print "ERROR: Pillow is not installed!"
|
||||||
|
|||||||
Reference in New Issue
Block a user