1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-17 19:51:45 +00:00

Removed redundant output

This commit is contained in:
Paweł Jastrzębski
2014-01-27 20:51:13 +01:00
parent 63d752280a
commit 27e5cc3b00
3 changed files with 4 additions and 12 deletions

View File

@@ -105,7 +105,6 @@ Options:
Replace screen height provided by device profile Replace screen height provided by device profile
OTHER: OTHER:
-v, --verbose Verbose output
-h, --help Show this help message and exit -h, --help Show this help message and exit
``` ```

View File

@@ -371,10 +371,6 @@ def fileImgProcess(work):
dirpath = work[1] dirpath = work[1]
opt = work[2] opt = work[2]
output = [] output = []
if opt.verbose:
print("Optimizing " + afile + " for " + opt.profile)
else:
print(".", end=' ')
img = image.ComicPage(os.path.join(dirpath, afile), opt.profileData) img = image.ComicPage(os.path.join(dirpath, afile), opt.profileData)
if opt.quality == 2: if opt.quality == 2:
wipe = False wipe = False
@@ -385,8 +381,6 @@ def fileImgProcess(work):
else: else:
splitter = img.splitPage(dirpath, opt.righttoleft, opt.rotate) splitter = img.splitPage(dirpath, opt.righttoleft, opt.rotate)
if splitter is not None: if splitter is not None:
if opt.verbose:
print("Splitted " + afile)
img0 = image.ComicPage(splitter[0], opt.profileData) img0 = image.ComicPage(splitter[0], opt.profileData)
applyImgOptimization(img0, opt) applyImgOptimization(img0, opt)
output.append(img0.saveToDir(dirpath, opt.forcepng, opt.forcecolor)) output.append(img0.saveToDir(dirpath, opt.forcepng, opt.forcecolor))
@@ -933,8 +927,6 @@ def main(argv=None, qtGUI=None):
help="Replace screen width provided by device profile") help="Replace screen width provided by device profile")
customProfileOptions.add_option("--customheight", type="int", dest="customheight", default=0, customProfileOptions.add_option("--customheight", type="int", dest="customheight", default=0,
help="Replace screen height provided by device profile") help="Replace screen height provided by device profile")
otherOptions.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="Verbose output")
otherOptions.add_option("-h", "--help", action="help", otherOptions.add_option("-h", "--help", action="help",
help="Show this help message and exit") help="Show this help message and exit")
parser.add_option_group(mainOptions) parser.add_option_group(mainOptions)
@@ -953,6 +945,7 @@ def main(argv=None, qtGUI=None):
parser.print_help() parser.print_help()
return return
path = getWorkFolder(args[0]) path = getWorkFolder(args[0])
print("\nChecking images...")
detectCorruption(path + "/OEBPS/Images/", args[0]) detectCorruption(path + "/OEBPS/Images/", args[0])
checkComicInfo(path + "/OEBPS/Images/", args[0]) checkComicInfo(path + "/OEBPS/Images/", args[0])
if options.webtoon: if options.webtoon:

View File

@@ -123,7 +123,6 @@ def splitImage(work):
# Harcoded opttions # Harcoded opttions
threshold = 1.0 threshold = 1.0
delta = 15 delta = 15
print(".", end=' ')
fileExpanded = os.path.splitext(name) fileExpanded = os.path.splitext(name)
filePath = os.path.join(path, name) filePath = os.path.join(path, name)
image = Image.open(filePath) image = Image.open(filePath)
@@ -236,15 +235,15 @@ def main(argv=None, qtGUI=None):
if options.height > 0: if options.height > 0:
options.sourceDir = args[0] options.sourceDir = args[0]
options.targetDir = args[0] + "-Splitted" options.targetDir = args[0] + "-Splitted"
print("\nSplitting images...")
if os.path.isdir(options.sourceDir): if os.path.isdir(options.sourceDir):
rmtree(options.targetDir, True) rmtree(options.targetDir, True)
copytree(options.sourceDir, options.targetDir) copytree(options.sourceDir, options.targetDir)
work = [] work = []
pagenumber = 0 pagenumber = 1
splitWorkerOutput = [] splitWorkerOutput = []
splitWorkerPool = Pool() splitWorkerPool = Pool()
if options.merge: if options.merge:
print("\nMerging images...")
directoryNumer = 1 directoryNumer = 1
mergeWork = [] mergeWork = []
mergeWorkerOutput = [] mergeWorkerOutput = []
@@ -267,6 +266,7 @@ def main(argv=None, qtGUI=None):
if len(mergeWorkerOutput) > 0: if len(mergeWorkerOutput) > 0:
rmtree(options.targetDir, True) rmtree(options.targetDir, True)
raise RuntimeError("One of workers crashed. Cause: " + mergeWorkerOutput[0]) raise RuntimeError("One of workers crashed. Cause: " + mergeWorkerOutput[0])
print("\nSplitting images...")
for root, dirs, files in os.walk(options.targetDir, False): for root, dirs, files in os.walk(options.targetDir, False):
for name in files: for name in files:
if getImageFileName(name) is not None: if getImageFileName(name) is not None: