From bc5536667b5fe0f511c376d0b3811d6cde7db97e Mon Sep 17 00:00:00 2001 From: gwyn <29720696+avalonv@users.noreply.github.com> Date: Tue, 13 Dec 2022 09:16:00 -0300 Subject: [PATCH] fix: omit irrelevant objects, improve --config --- src/reCBZ/__main__.py | 15 ++++++++------- src/reCBZ/config.py | 32 ++++++++++++++++---------------- src/reCBZ/defaults.toml | 28 ++++++++++++++-------------- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/src/reCBZ/__main__.py b/src/reCBZ/__main__.py index 85601e6..3137323 100644 --- a/src/reCBZ/__main__.py +++ b/src/reCBZ/__main__.py @@ -300,14 +300,15 @@ def main(): setattr(config, key, val) if args.show_config: - private = re.compile('^[A-Z]|\\ tuple: return valid_fmts -preload_profile = _cfg["archive"]["ebookprofile"] -if preload_profile != '': - set_profile(preload_profile.upper()) +_preload_profile = _cfg["archive"]["ebook_profile"] +if _preload_profile != '': + set_profile(_preload_profile.upper()) diff --git a/src/reCBZ/defaults.toml b/src/reCBZ/defaults.toml index cf37d29..5d1031d 100644 --- a/src/reCBZ/defaults.toml +++ b/src/reCBZ/defaults.toml @@ -3,11 +3,11 @@ # whether to overwrite the original archive. dangerous overwrite = false # dry run. archive won't be saved, even if overwrite is used -nowrite = false +no_write = false # try to skip files with read errors -ignore = true +ignore_page_err = true # force write even if there are errors -force = false +force_write = false # level of logging: -1 = quiet. 0 = overlapping progress report. 1 = streaming # progress report. 2 = verbose messages. >2 = everything loglevel = 0 @@ -15,31 +15,31 @@ loglevel = 0 # 1 disables multiprocessing processes = 0 # number of images to sample when comparing image formats -samplecount = 5 +samples_count = 5 [archive] # default format to save archives as -archiveformat = 'cbz' +archive_format = 'cbz' # whether to further compress the zipfile after repacking -compresszip = false +compress_zip = false # default ereader profile to use, affects several other options -ebookprofile = '' +ebook_profile = '' # whether to write pages from right to left when using epub. rtl appears to be # unsupported on mobi -righttoleft = false +right_to_left = false [image] # default format to convert images to. leave empty to preserve original -imageformat = '' +img_format = '' # compression quality for lossy images -quality = 80 +img_quality = 80 # new image width / height. set to 0,0 to preserve original dimensions -size = [0,0] +img_size = [0,0] # set to True to disable upscaling of images smaller than resolution -noupscale = false +no_upscale = false # set to True to disable downscaling of images larger than resolution -nodownscale = false +no_downscale = false # whether to convert images to grayscale grayscale = false # space separated list of image formats to always exclude from --compare -blacklistedfmts = '' +blacklisted_fmts = ''