diff --git a/README.md b/README.md index 1879063..fd52703 100644 --- a/README.md +++ b/README.md @@ -180,12 +180,16 @@ Options: page numbers [Default=2] --cp=CROPPINGP, --croppingpower=CROPPINGP 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 --whiteborders Disable autodetection and force white borders --forcecolor Don't convert images to grayscale --forcepng Create PNG files instead JPEG --mozjpeg Create JPEG files using mozJpeg --maximizestrips Turn 1x4 strips to 2x2 strips + -d, --delete Delete source file(s) or a directory. It's not + recoverable. CUSTOM PROFILE: --customwidth=CUSTOMWIDTH diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index e1941be..2b25596 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -996,6 +996,9 @@ def makeParser(): help="Create JPEG files using mozJpeg") processingOptions.add_option("--maximizestrips", action="store_true", dest="maximizestrips", default=False, 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, help="Replace screen width provided by device profile") 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') if k.path and k.coverSupport: 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