mirror of
https://github.com/ciromattia/kcc
synced 2026-07-02 19:15:28 +00:00
Merge pull request #485 from Constantin1489/master
comic2ebook/func: Add a delete option
This commit is contained in:
@@ -180,12 +180,16 @@ Options:
|
|||||||
page numbers [Default=2]
|
page numbers [Default=2]
|
||||||
--cp=CROPPINGP, --croppingpower=CROPPINGP
|
--cp=CROPPINGP, --croppingpower=CROPPINGP
|
||||||
Set cropping power [Default=1.0]
|
Set cropping power [Default=1.0]
|
||||||
|
--cm=CROPPINGM, --croppingminimum=CROPPINGM
|
||||||
|
Set cropping minimum area ratio [Default=0.0]
|
||||||
--blackborders Disable autodetection and force black borders
|
--blackborders Disable autodetection and force black borders
|
||||||
--whiteborders Disable autodetection and force white borders
|
--whiteborders Disable autodetection and force white borders
|
||||||
--forcecolor Don't convert images to grayscale
|
--forcecolor Don't convert images to grayscale
|
||||||
--forcepng Create PNG files instead JPEG
|
--forcepng Create PNG files instead JPEG
|
||||||
--mozjpeg Create JPEG files using mozJpeg
|
--mozjpeg Create JPEG files using mozJpeg
|
||||||
--maximizestrips Turn 1x4 strips to 2x2 strips
|
--maximizestrips Turn 1x4 strips to 2x2 strips
|
||||||
|
-d, --delete Delete source file(s) or a directory. It's not
|
||||||
|
recoverable.
|
||||||
|
|
||||||
CUSTOM PROFILE:
|
CUSTOM PROFILE:
|
||||||
--customwidth=CUSTOMWIDTH
|
--customwidth=CUSTOMWIDTH
|
||||||
|
|||||||
@@ -996,6 +996,9 @@ def makeParser():
|
|||||||
help="Create JPEG files using mozJpeg")
|
help="Create JPEG files using mozJpeg")
|
||||||
processingOptions.add_option("--maximizestrips", action="store_true", dest="maximizestrips", default=False,
|
processingOptions.add_option("--maximizestrips", action="store_true", dest="maximizestrips", default=False,
|
||||||
help="Turn 1x4 strips to 2x2 strips")
|
help="Turn 1x4 strips to 2x2 strips")
|
||||||
|
processingOptions.add_option("-d", "--delete", action="store_true", dest="delete", default=False,
|
||||||
|
help="Delete source file(s) or a directory. It's not recoverable.")
|
||||||
|
|
||||||
customProfileOptions.add_option("--customwidth", type="int", dest="customwidth", default=0,
|
customProfileOptions.add_option("--customwidth", type="int", dest="customwidth", default=0,
|
||||||
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,
|
||||||
@@ -1225,6 +1228,12 @@ def makeBook(source, qtgui=None):
|
|||||||
os.remove(i.replace('.epub', '.mobi') + '_toclean')
|
os.remove(i.replace('.epub', '.mobi') + '_toclean')
|
||||||
if k.path and k.coverSupport:
|
if k.path and k.coverSupport:
|
||||||
options.covers[filepath.index(i)][0].saveToKindle(k, options.covers[filepath.index(i)][1])
|
options.covers[filepath.index(i)][0].saveToKindle(k, options.covers[filepath.index(i)][1])
|
||||||
|
if options.delete:
|
||||||
|
if os.path.isfile(source):
|
||||||
|
os.remove(source)
|
||||||
|
elif os.path.isdir(source):
|
||||||
|
rmtree(source)
|
||||||
|
|
||||||
return filepath
|
return filepath
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user