From 261c60156d20b64bc78ebd659cbea201da8b4626 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sat, 11 Jun 2022 22:55:50 +0200 Subject: [PATCH] Improved configuration settings and added comments --- maintain.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/maintain.py b/maintain.py index 70556fd..5265a6f 100755 --- a/maintain.py +++ b/maintain.py @@ -21,16 +21,22 @@ warn = partial(print, file=sys.stderr) # === Configuration +# name of directory to hold index INDEX_DIR = ".index" +# name of directory where new pages will be stored DEFAULT_CATEGORY = "_toSort" +# languages to apply OCR in OCR_LANGS = [ "deu", "eng", ] -DEFAULT_SCAN_SOURCE = "ADF Duplex" -ALTERNATE_SCAN_SOURCE = "Flatbed" +# Scan sources to use, depend on scanner, find out with "scanimge -L" +ADF_SCAN_SOURCE = "ADF Duplex" +FLATBED_SCAN_SOURCE = "Flatbed" +# Minimum width / length of IDs in index direcory MIN_NUM_WIDTH = 6 # only used for INDEX_DIR files +# How many pages are displayed as context ID_AROUND_RANGE = 10 @@ -591,7 +597,7 @@ def cmd_scan(args, scans): scans = list(scans) cmd = [ "scanimage", - "--source", ALTERNATE_SCAN_SOURCE if args.flatbed else DEFAULT_SCAN_SOURCE, + "--source", FLATBED_SCAN_SOURCE if args.flatbed else ADF_SCAN_SOURCE, "--batch", "--batch-start", str(args.force_next_id or next_id(scans)), "--batch-print",