Skip to content

Commit

Permalink
OptionParser to ArgumentParser
Browse files Browse the repository at this point in the history
  • Loading branch information
darodi committed May 13, 2023
1 parent 85c1801 commit bd52d0e
Show file tree
Hide file tree
Showing 8 changed files with 255 additions and 258 deletions.
132 changes: 62 additions & 70 deletions README.md
Expand Up @@ -136,89 +136,81 @@ sudo apt-get install python3 p7zip-full python3-pil python3-psutil python3-slugi
### Standalone `kcc-c2e.py` usage:

```
Usage: kcc-c2e [options] comic_file|comic_folder
Options:
MAIN:
-p PROFILE, --profile=PROFILE
Device profile (Available options: K1, K2, K34, K578,
KDX, KPW, KPW5, KV, KO, K11, KS, KoMT, KoG, KoGHD,
KoA, KoAHD, KoAH2O, KoAO, KoN, KoC, KoL, KoF, KoS,
KoE) [Default=KV]
-m, --manga-style Manga style (right-to-left reading and splitting)
-q, --hq Try to increase the quality of magnification
-2, --two-panel Display two not four panels in Panel View mode
-w, --webtoon Webtoon processing mode
--targetsize=TARGETSIZE
the maximal size of output file in MB. [Default=100MB
for webtoon and 400MB for others]
OUTPUT SETTINGS:
-o OUTPUT, --output=OUTPUT
Output generated file to specified directory or file
-t TITLE, --title=TITLE
Comic title [Default=filename or directory name]
-f FORMAT, --format=FORMAT
Output format (Available options: Auto, MOBI, EPUB,
CBZ, KFX, MOBI+EPUB) [Default=Auto]
-b BATCHSPLIT, --batchsplit=BATCHSPLIT
Split output into multiple files. 0: Don't split 1:
Automatic mode 2: Consider every subdirectory as
separate volume [Default=0]
PROCESSING:
-n, --noprocessing Do not modify image and ignore any profil or
processing option
-u, --upscale Resize images smaller than device's resolution
-s, --stretch Stretch images to device's resolution
-r SPLITTER, --splitter=SPLITTER
Double page parsing mode. 0: Split 1: Rotate 2: Both
[Default=0]
-g GAMMA, --gamma=GAMMA
Apply gamma correction to linearize the image
[Default=Auto]
-c CROPPING, --cropping=CROPPING
Set cropping mode. 0: Disabled 1: Margins 2: Margins +
page numbers [Default=2]
--cp=CROPPINGP, --croppingpower=CROPPINGP
usage: kcc-c2e [options] [input]
MANDATORY:
input Full path to comic folder or file(s) to be processed.
MAIN:
-p PROFILE, --profile PROFILE
Device profile (Available options: K1, K2, K34, K578, KDX, KPW, KPW5, KV, KO, K11, KS, KoMT, KoG, KoGHD, KoA, KoAHD, KoAH2O, KoAO, KoN, KoC, KoL, KoF, KoS, KoE) [Default=KV]
-m, --manga-style Manga style (right-to-left reading and splitting)
-q, --hq Try to increase the quality of magnification
-2, --two-panel Display two not four panels in Panel View mode
-w, --webtoon Webtoon processing mode
--ts TARGETSIZE, --targetsize TARGETSIZE
the maximal size of output file in MB. [Default=100MB for webtoon and 400MB for others]
PROCESSING:
-n, --noprocessing Do not modify image and ignore any profil or processing option
-u, --upscale Resize images smaller than device's resolution
-s, --stretch Stretch images to device's resolution
-r SPLITTER, --splitter SPLITTER
Double page parsing mode. 0: Split 1: Rotate 2: Both [Default=0]
-g GAMMA, --gamma GAMMA
Apply gamma correction to linearize the image [Default=Auto]
-c CROPPING, --cropping CROPPING
Set cropping mode. 0: Disabled 1: Margins 2: Margins + page numbers [Default=2]
--cp CROPPINGP, --croppingpower CROPPINGP
Set cropping power [Default=1.0]
--cm=CROPPINGM, --croppingminimum=CROPPINGM
--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
--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.
OUTPUT SETTINGS:
-o OUTPUT, --output OUTPUT
Output generated file to specified directory or file
-t TITLE, --title TITLE
Comic title [Default=filename or directory name]
-f FORMAT, --format FORMAT
Output format (Available options: Auto, MOBI, EPUB, CBZ, KFX, MOBI+EPUB) [Default=Auto]
-b BATCHSPLIT, --batchsplit BATCHSPLIT
Split output into multiple files. 0: Don't split 1: Automatic mode 2: Consider every subdirectory as separate volume [Default=0]
CUSTOM PROFILE:
--customwidth CUSTOMWIDTH
Replace screen width provided by device profile
--customheight=CUSTOMHEIGHT
--customheight CUSTOMHEIGHT
Replace screen height provided by device profile
OTHER:
-h, --help Show this help message and exit
OTHER:
-h, --help Show this help message and exit
```

### Standalone `kcc-c2p.py` usage:

```
Usage: kcc-c2p [options] comic_folder
usage: kcc-c2p [options] [input]
MANDATORY:
input Full path to comic folder(s) to be processed. Separate multiple inputs with spaces.
Options:
MANDATORY:
-y HEIGHT, --height=HEIGHT
MAIN:
-y HEIGHT, --height HEIGHT
Height of the target device screen
-i, --in-place Overwrite source directory
-m, --merge Combine every directory into a single image before
splitting
-i, --in-place Overwrite source directory
-m, --merge Combine every directory into a single image before splitting
OTHER:
-d, --debug Create debug file for every split image
-h, --help Show this help message and exit
OTHER:
-d, --debug Create debug file for every split image
-h, --help Show this help message and exit
```

## CREDITS
Expand Down
5 changes: 3 additions & 2 deletions kcc-c2e.py
Expand Up @@ -19,8 +19,9 @@
# PERFORMANCE OF THIS SOFTWARE.

import sys
if sys.version_info[0] != 3:
print('ERROR: This is Python 3 script!')

if sys.version_info < (3, 8, 0):
print('ERROR: This is a Python 3.8+ script!')
exit(1)

from multiprocessing import freeze_support, set_start_method
Expand Down
5 changes: 3 additions & 2 deletions kcc-c2p.py
Expand Up @@ -19,8 +19,9 @@
# PERFORMANCE OF THIS SOFTWARE.

import sys
if sys.version_info[0] != 3:
print('ERROR: This is Python 3 script!')

if sys.version_info < (3, 8, 0):
print('ERROR: This is a Python 3.8+ script!')
exit(1)

from multiprocessing import freeze_support, set_start_method
Expand Down
5 changes: 3 additions & 2 deletions kcc.py
Expand Up @@ -19,8 +19,9 @@
# PERFORMANCE OF THIS SOFTWARE.

import sys
if sys.version_info[0] != 3:
print('ERROR: This is Python 3 script!')

if sys.version_info < (3, 8, 0):
print('ERROR: This is a Python 3.8+ script!')
exit(1)

# OS specific workarounds
Expand Down
2 changes: 1 addition & 1 deletion kindlecomicconverter/KCC_gui.py
Expand Up @@ -255,7 +255,7 @@ def run(self):
MW.modeConvert.emit(0)

parser = comic2ebook.makeParser()
options, _ = parser.parse_args()
options = parser.parse_args()
argv = ''
currentJobs = []

Expand Down

0 comments on commit bd52d0e

Please sign in to comment.