From 347117c46af3f8c51bcac428a0ed5e58c5c32cf1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Sep 2021 14:13:47 +0000 Subject: [PATCH 01/32] Bump prospector from 1.5.0.1 to 1.5.1 Bumps [prospector](https://github.com/PyCQA/prospector) from 1.5.0.1 to 1.5.1. - [Release notes](https://github.com/PyCQA/prospector/releases) - [Changelog](https://github.com/PyCQA/prospector/blob/master/CHANGELOG.rst) - [Commits](https://github.com/PyCQA/prospector/compare/1.5.0.1...1.5.1) --- updated-dependencies: - dependency-name: prospector dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Pipfile | 2 +- Pipfile.lock | 57 +++++++++++++++++++++++++++------------------------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/Pipfile b/Pipfile index 205ca4af..6566a324 100644 --- a/Pipfile +++ b/Pipfile @@ -13,7 +13,7 @@ jsonschema-gentypes = "==0.9.4" "ruamel.yaml" = "==0.17.4" [dev-packages] -prospector = {extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "==1.5.0.1"} +prospector = {extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "==1.5.1"} flake8 = "==3.8.4" pytest = "==6.2.5" coverage = "==5.5" diff --git a/Pipfile.lock b/Pipfile.lock index 0d1ec2a6..692b98ad 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "737ccc9a31142572625f2c92e53287905e431cc467c76fe37fd045564e0de6f0" + "sha256": "948b60cf01bcfa762f78e8d805831fa1fa3ca55cda8677d11046fd1fec8d7b9d" }, "pipfile-spec": 6, "requires": { @@ -33,11 +33,11 @@ }, "charset-normalizer": { "hashes": [ - "sha256:0c8911edd15d19223366a194a513099a302055a962bca2cec0f54b8b63175d8b", - "sha256:f23667ebe1084be45f6ae0538e4a5a865206544097e4e8bbcacf42cd02a348f3" + "sha256:7098e7e862f6370a2a8d1a6398cd359815c45d12626267652c3f13dec58e2367", + "sha256:fa471a601dfea0f492e4f4fca035cd82155e65dc45c9b83bf4322dfab63755dd" ], "markers": "python_version >= '3'", - "version": "==2.0.4" + "version": "==2.0.5" }, "cycler": { "hashes": [ @@ -162,11 +162,11 @@ }, "networkx": { "hashes": [ - "sha256:2306f1950ce772c5a59a57f5486d59bb9cab98497c45fc49cbc45ac0dec119bb", - "sha256:5fcb7004be69e8fbdf07dcb502efa5c77cadcaad6982164134eeb9721f826c2e" + "sha256:80b6b89c77d1dfb64a4c7854981b60aeea6360ac02c6d4e4913319e0a313abef", + "sha256:c0946ed31d71f1b732b5aaa6da5a0388a345019af232ce2f49c766e2d6795c51" ], "markers": "python_version >= '3.7'", - "version": "==2.6.2" + "version": "==2.6.3" }, "numpy": { "hashes": [ @@ -290,7 +290,7 @@ "sha256:fd4fd83aa912d7b89b4b4a1580d30e2a4242f3936882a3f433586e5ab97ed0d5", "sha256:feb5db446e96bfecfec078b943cc07744cc759893cef045aa8b8b6d6aaa8274e" ], - "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==8.3.2" }, "pyparsing": { @@ -483,10 +483,11 @@ }, "unidecode": { "hashes": [ - "sha256:9f8235681cc520912fe02e7dd73d455c2f0471f39d36485bc278b97b3e2f2390", - "sha256:d01b0a22f7d90dea483da658782884de5162f40359fcaf79630738db93045c84" + "sha256:215fe33c9d1c889fa823ccb66df91b02524eb8cc8c9c80f9c5b8129754d27829", + "sha256:669898c1528912bcf07f9819dc60df18d057f7528271e31f8ec28cc88ef27504" ], - "version": "==1.3.0" + "markers": "python_version >= '3.5'", + "version": "==1.3.2" }, "urllib3": { "hashes": [ @@ -508,11 +509,11 @@ }, "astroid": { "hashes": [ - "sha256:3b680ce0419b8a771aba6190139a3998d14b413852506d99aff8dc2bf65ee67c", - "sha256:dc1e8b28427d6bbef6b8842b18765ab58f558c42bb80540bd7648c98412af25e" + "sha256:dcc06f6165f415220013801642bd6c9808a02967070919c4b746c6864c205471", + "sha256:fe81f80c0b35264acb5653302ffbd935d394f1775c5e4487df745bf9c2442708" ], "markers": "python_version ~= '3.6'", - "version": "==2.7.3" + "version": "==2.8.0" }, "attrs": { "hashes": [ @@ -538,11 +539,11 @@ }, "charset-normalizer": { "hashes": [ - "sha256:0c8911edd15d19223366a194a513099a302055a962bca2cec0f54b8b63175d8b", - "sha256:f23667ebe1084be45f6ae0538e4a5a865206544097e4e8bbcacf42cd02a348f3" + "sha256:7098e7e862f6370a2a8d1a6398cd359815c45d12626267652c3f13dec58e2367", + "sha256:fa471a601dfea0f492e4f4fca035cd82155e65dc45c9b83bf4322dfab63755dd" ], "markers": "python_version >= '3'", - "version": "==2.0.4" + "version": "==2.0.5" }, "coverage": { "hashes": [ @@ -674,7 +675,7 @@ "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899", "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2" ], - "markers": "python_version < '4' and python_full_version >= '3.6.1'", + "markers": "python_version < '4.0' and python_full_version >= '3.6.1'", "version": "==5.9.3" }, "lazy-object-proxy": { @@ -793,11 +794,11 @@ "with_pyroma" ], "hashes": [ - "sha256:d0befb6148c78e7cfcfae32d2f6daf80a15d2b2bfe730f1e9d3af1742579a530", - "sha256:d5ef79c0b62e18d7aee78a72073f76017becf303c82b77fa5c8e1ac9c2818a80" + "sha256:47f8ff3fd36ae276967eb392ca20b300a7bdea66c0d0252250a4d89a6c03ab15", + "sha256:851c2892cd615cfee91fd27cfaf7a5061d14daf2853aa8f012e927b98f919578" ], "index": "pypi", - "version": "==1.5.0.1" + "version": "==1.5.1" }, "py": { "hashes": [ @@ -841,11 +842,11 @@ }, "pylint": { "hashes": [ - "sha256:6758cce3ddbab60c52b57dcc07f0c5d779e5daf0cf50f6faacbef1d3ea62d2a1", - "sha256:e178e96b6ba171f8ef51fbce9ca30931e6acbea4a155074d80cc081596c9e852" + "sha256:0f358e221c45cbd4dad2a1e4b883e75d28acdcccd29d40c76eb72b307269b126", + "sha256:2c9843fff1a88ca0ad98a256806c82c5a8f86086e7ccbdb93297d86c3f90c436" ], "markers": "python_version ~= '3.6'", - "version": "==2.10.2" + "version": "==2.11.1" }, "pylint-celery": { "hashes": [ @@ -955,11 +956,12 @@ ], "version": "==0.7" }, - "setoptconf": { + "setoptconf-tmp": { "hashes": [ - "sha256:5b0b5d8e0077713f5d5152d4f63be6f048d9a1bb66be15d089a11c898c3cf49c" + "sha256:76035d5cd1593d38b9056ae12d460eca3aaa34ad05c315b69145e138ba80a745", + "sha256:e0480addd11347ba52f762f3c4d8afa3e10ad0affbc53e3ffddc0ca5f27d5778" ], - "version": "==0.2.0" + "version": "==0.3.1" }, "six": { "hashes": [ @@ -1006,6 +1008,7 @@ "sha256:d8226d10bc02a29bcc81df19a26e56a9647f8b0a6d4a83924139f4a8b01f17b7", "sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34" ], + "markers": "python_version < '3.10'", "version": "==3.10.0.2" }, "urllib3": { From a9db2ddf633e32c004af6be72bd2187c6fc35733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Sun, 19 Sep 2021 08:04:14 +0200 Subject: [PATCH 02/32] Fix new pylint errors --- scan_to_paperless/process.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index a4b76352..9af0b6a6 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -807,12 +807,8 @@ def split( if nb_vertical * nb_horizontal != len(assisted_split["destinations"]): raise Exception( - "Wrong number of destinations ({}), vertical: {}, height: {}, img '{}'".format( - len(assisted_split["destinations"]), - nb_horizontal, - nb_vertical, - assisted_split["source"], - ) + f"Wrong number of destinations ({len(assisted_split['destinations'])}), " + f"vertical: {nb_horizontal}, height: {nb_vertical}, img '{assisted_split['source']}'" ) for assisted_split in config["assisted_split"]: @@ -867,12 +863,8 @@ def split( CONVERT + [ "-crop", - "{}x{}+{}+{}".format( - vertical_value - vertical_margin - last_x, - horizontal_value - horizontal_margin - last_y, - last_x, - last_y, - ), + f"{vertical_value - vertical_margin - last_x}x" + f"{horizontal_value - horizontal_margin - last_y}+{last_x}+{last_y}", "+repage", img, process_file.name, @@ -969,9 +961,8 @@ def finalise( file_name = os.path.join(root_folder, f"{name}.pdf") if config["args"].get("tesseract", True): call( - "tesseract -l {} {} stdout pdf > {}".format( - config["args"].get("tesseract_lang", "fra+eng"), img, file_name - ), + f'tesseract -l {config["args"].get("tesseract_lang", "fra+eng")} {img} stdout pdf' + f" > {file_name}", shell=True, # nosec ) else: From 0a235c0fe2b1adc5442bfafea3e9acd51eb33a93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Sep 2021 15:55:19 +0000 Subject: [PATCH 03/32] Bump flake8 from 3.8.4 to 3.9.2 --- Pipfile | 2 +- Pipfile.lock | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Pipfile b/Pipfile index 6566a324..f6ab6faa 100644 --- a/Pipfile +++ b/Pipfile @@ -14,7 +14,7 @@ jsonschema-gentypes = "==0.9.4" [dev-packages] prospector = {extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "==1.5.1"} -flake8 = "==3.8.4" +flake8 = "==3.9.2" pytest = "==6.2.5" coverage = "==5.5" pytest-profiling = "==1.7.0" diff --git a/Pipfile.lock b/Pipfile.lock index 692b98ad..2dffd49c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "948b60cf01bcfa762f78e8d805831fa1fa3ca55cda8677d11046fd1fec8d7b9d" + "sha256": "06585f616680f0356477a5a55c4f15742e953e9b39d313daa126c87c6428183b" }, "pipfile-spec": 6, "requires": { @@ -33,11 +33,11 @@ }, "charset-normalizer": { "hashes": [ - "sha256:7098e7e862f6370a2a8d1a6398cd359815c45d12626267652c3f13dec58e2367", - "sha256:fa471a601dfea0f492e4f4fca035cd82155e65dc45c9b83bf4322dfab63755dd" + "sha256:5d209c0a931f215cee683b6445e2d77677e7e75e159f78def0db09d68fafcaa6", + "sha256:5ec46d183433dcbd0ab716f2d7f29d8dee50505b3fdb40c6b985c7c4f5a3591f" ], "markers": "python_version >= '3'", - "version": "==2.0.5" + "version": "==2.0.6" }, "cycler": { "hashes": [ @@ -539,11 +539,11 @@ }, "charset-normalizer": { "hashes": [ - "sha256:7098e7e862f6370a2a8d1a6398cd359815c45d12626267652c3f13dec58e2367", - "sha256:fa471a601dfea0f492e4f4fca035cd82155e65dc45c9b83bf4322dfab63755dd" + "sha256:5d209c0a931f215cee683b6445e2d77677e7e75e159f78def0db09d68fafcaa6", + "sha256:5ec46d183433dcbd0ab716f2d7f29d8dee50505b3fdb40c6b985c7c4f5a3591f" ], "markers": "python_version >= '3'", - "version": "==2.0.5" + "version": "==2.0.6" }, "coverage": { "hashes": [ @@ -620,11 +620,11 @@ }, "flake8": { "hashes": [ - "sha256:749dbbd6bfd0cf1318af27bf97a14e28e5ff548ef8e5b1566ccfb25a11e7c839", - "sha256:aadae8761ec651813c24be05c6f7b4680857ef6afaae4651a4eccaef97ce6c3b" + "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b", + "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907" ], "index": "pypi", - "version": "==3.8.4" + "version": "==3.9.2" }, "flake8-polyfill": { "hashes": [ @@ -643,11 +643,11 @@ }, "gitpython": { "hashes": [ - "sha256:b838a895977b45ab6f0cc926a9045c8d1c44e2b653c1fcc39fe91f42c6e8f05b", - "sha256:fce760879cd2aebd2991b3542876dc5c4a909b30c9d69dfc488e504a8db37ee8" + "sha256:dc0a7f2f697657acc8d7f89033e8b1ea94dd90356b2983bca89dc8d2ab3cc647", + "sha256:df83fdf5e684fef7c6ee2c02fc68a5ceb7e7e759d08b694088d0cacb4eba59e5" ], - "markers": "python_version >= '3.6'", - "version": "==3.1.18" + "markers": "python_version >= '3.7'", + "version": "==3.1.24" }, "gprof2dot": { "hashes": [ @@ -810,11 +810,11 @@ }, "pycodestyle": { "hashes": [ - "sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367", - "sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e" + "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068", + "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.6.0" + "version": "==2.7.0" }, "pydocstyle": { "hashes": [ @@ -826,11 +826,11 @@ }, "pyflakes": { "hashes": [ - "sha256:0d94e0e05a19e57a99444b6ddcf9a6eb2e5c68d3ca1e98e90707af8152c90a92", - "sha256:35b2d75ee967ea93b55750aa9edbbf72813e06a66ba54438df2cfac9e3c27fc8" + "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905b22bbffe52efc3", + "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.2.0" + "version": "==2.3.1" }, "pygments": { "hashes": [ From db7732625997a4598cc3de1bcfeb5d86becc9aa1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Sep 2021 14:19:06 +0000 Subject: [PATCH 04/32] Bump c2cciutils from 1.1.dev20210915084344 to 1.1.dev20210921153209 --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index 2f0812df..c934f5c4 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,2 +1,2 @@ -c2cciutils==1.1.dev20210915084344 +c2cciutils==1.1.dev20210921153209 jsonschema2md==0.2.1 From 9020dbd870f7cf32a669b4f3a7d902495f5aba43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 24 Sep 2021 20:42:59 +0200 Subject: [PATCH 05/32] Better use of average_deviation move image_status to image_config.status --- config.md | 10 ++-- process.md | 11 ++--- scan_to_paperless/config.py | 10 ++-- scan_to_paperless/config_schema.json | 10 ++-- scan_to_paperless/process.py | 21 +++++--- scan_to_paperless/process_schema.json | 71 ++++++++++++++------------- scan_to_paperless/process_schema.py | 22 +++++---- 7 files changed, 83 insertions(+), 72 deletions(-) diff --git a/config.md b/config.md index 66eaeaca..5ae81d2e 100644 --- a/config.md +++ b/config.md @@ -13,17 +13,17 @@ - **`args`** *(object)*: Cannot contain additional properties. - **`level`** *(['boolean', 'integer'])*: true: => do level on 15% - 85% (under 15 % will be black above 85% will be white), false: => 0% - 100%, : => (0 + )% - (100 - number)%. - **`auto_level`** *(boolean)*: If no level specified, do auto level. Default: `False`. - - **`min_level`** *(integer)*: Min level if no level end no autolovel. Default: `15`. - - **`max_level`** *(integer)*: Max level if no level end no autolovel. Default: `15`. + - **`min_level`** *(integer)*: Min level if no level end no auto-level. Default: `15`. + - **`max_level`** *(integer)*: Max level if no level end no auto-level. Default: `15`. - **`no_crop`** *(boolean)*: Don't do any crop. Default: `False`. - - **`margin_horizontal`** *(number)*: The horizontal margin used on autodetect content [mm]. Default: `9`. - - **`margin_vertical`** *(number)*: The vertical margin used on autodetect content [mm]. Default: `6`. + - **`margin_horizontal`** *(number)*: The horizontal margin used on auto-detect content [mm]. Default: `9`. + - **`margin_vertical`** *(number)*: The vertical margin used on auto-detect content [mm]. Default: `6`. - **`dpi`** *(number)*: The DPI used to convert the mm to pixel. Default: `300`. - **`sharpen`** *(boolean)*: Do the sharpen. Default: `False`. - **`dither`** *(boolean)*: Do the dither. Default: `False`. - **`tesseract`** *(boolean)*: Use tesseract to to an OCR on the document. Default: `False`. - **`tesseract_lang`** *(string)*: The used language for tesseract. Default: `fra+eng`. - - **`assisted_split`** *(boolean)*: Do en assited split. Default: `False`. + - **`assisted_split`** *(boolean)*: Do en assisted split. Default: `False`. - **`min_box_size_crop`** *(number)*: The minimum box size to find the content on witch one we will crop [mm]. Default: `3`. - **`min_box_size_limit`** *(number)*: The minimum box size to find the limits based on content [mm]. Default: `10`. - **`min_box_size_empty`** *(number)*: The minimum box size to find the content to determine if the page is empty [mm]. Default: `10`. diff --git a/process.md b/process.md index 3c0bdb1e..53a10a49 100644 --- a/process.md +++ b/process.md @@ -13,7 +13,7 @@ - **Items** *(string)* - **`process_count`** *(integer)*: The step number. - **`assisted_split`** *(array)* - - **Items** *(object)*: Assited split configuration. Cannot contain additional properties. + - **Items** *(object)*: Assisted split configuration. Cannot contain additional properties. - **`source`** *(string)* - **`destinations`** *(array)* - **Items** *(['integer', 'string'])* @@ -33,17 +33,16 @@ - **`traceback`** *(array)* - **Items** *(string)* - **`images_config`** *(object)*: Can contain additional properties. -- **`images_status`** *(object)*: Can contain additional properties. ## Definitions - **`args`** *(object)* - **`level`** *(['boolean', 'integer'])*: true: => do level on 15% - 85% (under 15 % will be black above 85% will be white), false: => 0% - 100%, : => (0 + )% - (100 - number)%. - **`auto_level`** *(boolean)*: If no level specified, do auto level. Default: `False`. - - **`min_level`** *(integer)*: Min level if no level end no autolovel. Default: `15`. - - **`max_level`** *(integer)*: Max level if no level end no autolovel. Default: `15`. + - **`min_level`** *(integer)*: Min level if no level end no auto-level. Default: `15`. + - **`max_level`** *(integer)*: Max level if no level end no auto-level. Default: `15`. - **`no_crop`** *(boolean)*: Don't do any crop. Default: `False`. - - **`margin_horizontal`** *(number)*: The horizontal margin used on autodetect content [mm]. Default: `9`. - - **`margin_vertical`** *(number)*: The vertical margin used on autodetect content [mm]. Default: `6`. + - **`margin_horizontal`** *(number)*: The horizontal margin used on auto-detect content [mm]. Default: `9`. + - **`margin_vertical`** *(number)*: The vertical margin used on auto-detect content [mm]. Default: `6`. - **`dpi`** *(number)*: The DPI used to convert the mm to pixel. Default: `300`. - **`sharpen`** *(boolean)*: Do the sharpen. Default: `False`. - **`dither`** *(boolean)*: Do the dither. Default: `False`. diff --git a/scan_to_paperless/config.py b/scan_to_paperless/config.py index 69909169..969ad30f 100644 --- a/scan_to_paperless/config.py +++ b/scan_to_paperless/config.py @@ -10,11 +10,11 @@ # # default: False "auto_level": bool, - # Min level if no level end no autolovel + # Min level if no level end no auto-level # # default: 15 "min_level": int, - # Max level if no level end no autolovel + # Max level if no level end no auto-level # # default: 15 "max_level": int, @@ -22,11 +22,11 @@ # # default: False "no_crop": bool, - # The horizontal margin used on autodetect content [mm] + # The horizontal margin used on auto-detect content [mm] # # default: 9 "margin_horizontal": Union[int, float], - # The vertical margin used on autodetect content [mm] + # The vertical margin used on auto-detect content [mm] # # default: 6 "margin_vertical": Union[int, float], @@ -50,7 +50,7 @@ # # default: fra+eng "tesseract_lang": str, - # Do en assited split + # Do en assisted split # # default: False "assisted_split": bool, diff --git a/scan_to_paperless/config_schema.json b/scan_to_paperless/config_schema.json index 152189cc..2b0663b3 100644 --- a/scan_to_paperless/config_schema.json +++ b/scan_to_paperless/config_schema.json @@ -21,12 +21,12 @@ }, "min_level": { "type": "integer", - "description": "Min level if no level end no autolovel", + "description": "Min level if no level end no auto-level", "default": 15 }, "max_level": { "type": "integer", - "description": "Max level if no level end no autolovel", + "description": "Max level if no level end no auto-level", "default": 15 }, "no_crop": { @@ -37,12 +37,12 @@ "margin_horizontal": { "type": "number", "default": 9, - "description": "The horizontal margin used on autodetect content [mm]" + "description": "The horizontal margin used on auto-detect content [mm]" }, "margin_vertical": { "type": "number", "default": 6, - "description": "The vertical margin used on autodetect content [mm]" + "description": "The vertical margin used on auto-detect content [mm]" }, "dpi": { "type": "number", @@ -72,7 +72,7 @@ "assisted_split": { "type": "boolean", "default": false, - "description": "Do en assited split" + "description": "Do en assisted split" }, "min_box_size_crop": { "type": "number", diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 9af0b6a6..03858137 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -11,7 +11,7 @@ import tempfile import time import traceback -from typing import IO, TYPE_CHECKING, Any, Dict, List, Optional, Tuple, TypedDict, Union, cast +from typing import IO, TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple, TypedDict, Union, cast # read, write, rotate, crop, sharpen, draw_line, find_line, find_contour import cv2 @@ -413,9 +413,9 @@ def deskew(context: Context) -> None: images_config = context.config.setdefault("images_config", {}) assert context.image_name image_config = images_config.setdefault(context.image_name, {}) + image_status = image_config.setdefault("status", {}) angle = image_config.setdefault("angle", None) if angle is None: - image_status = context.config["images_status"][context.image_name] image = context.get_masked() grayscale = rgb2gray(image) image = cast(np_ndarray_int, context.image).copy() @@ -424,13 +424,19 @@ def deskew(context: Context) -> None: if angle is not None: image_status["angle"] = nice_angle(float(angle)) draw_angle(image, angle, (255, 0, 0)) - image_status["average_deviation"] = float(average_deviation) - float_angles = set() + float_angles: Set[float] = set() + average_deviation_float = float(average_deviation) + image_status["average_deviation"] = average_deviation_float + average_deviation2 = nice_angle(average_deviation_float - 45) + image_status["average_deviation2"] = average_deviation2 + float_angles.add(average_deviation2) + for current_angles in angles: for current_angle in current_angles: float_angles.add(nice_angle(float(current_angle))) - draw_angle(image, current_angle, (0, 255, 0)) + for current_angle in float_angles: + draw_angle(image, current_angle, (0, 255, 0)) image_status["angles"] = list(float_angles) assert context.root_folder @@ -686,8 +692,9 @@ def transform( if context.image_name is None: raise Exception("Image name is required") context.image = cv2.imread(os.path.join(root_folder, img)) - images_status = context.config.setdefault("images_status", {}) - image_status = images_status.setdefault(context.image_name, {}) + images_config = context.config.setdefault("images_config", {}) + image_config = images_config.setdefault(context.image_name, {}) + image_status = image_config.setdefault("status", {}) assert context.image is not None image_status["size"] = context.image.shape[:2][::-1] mask_file = os.path.join(os.path.dirname(root_folder), "mask.png") diff --git a/scan_to_paperless/process_schema.json b/scan_to_paperless/process_schema.json index aa9d0392..cbd82ec1 100644 --- a/scan_to_paperless/process_schema.json +++ b/scan_to_paperless/process_schema.json @@ -20,12 +20,12 @@ }, "min_level": { "type": "integer", - "description": "Min level if no level end no autolovel", + "description": "Min level if no level end no auto-level", "default": 15 }, "max_level": { "type": "integer", - "description": "Max level if no level end no autolovel", + "description": "Max level if no level end no auto-level", "default": 15 }, "no_crop": { @@ -36,12 +36,12 @@ "margin_horizontal": { "type": "number", "default": 9, - "description": "The horizontal margin used on autodetect content [mm]" + "description": "The horizontal margin used on auto-detect content [mm]" }, "margin_vertical": { "type": "number", "default": 6, - "description": "The vertical margin used on autodetect content [mm]" + "description": "The vertical margin used on auto-detect content [mm]" }, "dpi": { "type": "number", @@ -170,7 +170,7 @@ "type": "object", "additionalProperties": false, - "description": "Assited split configuration", + "description": "Assisted split configuration", "properties": { "source": { "type": "string", @@ -256,37 +256,38 @@ "properties": { "angle": { "type": ["number", "null"], - "description": "The used angle to deskex, can be change, restart by deleting one of the generated images" - } - } - } - }, - "images_status": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": false, - "properties": { - "angle": { - "type": "number", - "description": "The measured deskew angle" + "description": "The used angle to deskew, can be change, restart by deleting one of the generated images" }, - "average_deviation": { - "type": "number", - "description": "The measured deskew angle deviation" - }, - "angles": { - "type": "array", - "description": "The measured possible deskew angles, visible on the generated image", - "items": { - "type": "number" - } - }, - "size": { - "type": "array", - "description": "The image dimensions", - "items": { - "type": "number" + "status": { + "type": "object", + "additionalProperties": false, + "properties": { + "angle": { + "type": "number", + "description": "The measured deskew angle" + }, + "average_deviation": { + "type": "number", + "description": "The measured deskew angle deviation" + }, + "average_deviation2": { + "type": "number", + "description": "The measured deskew angle deviation, corrected" + }, + "angles": { + "type": "array", + "description": "The measured possible deskew angles, visible on the generated image", + "items": { + "type": "number" + } + }, + "size": { + "type": "array", + "description": "The image dimensions", + "items": { + "type": "number" + } + } } } } diff --git a/scan_to_paperless/process_schema.py b/scan_to_paperless/process_schema.py index 797d8b0d..ddd7d3c0 100644 --- a/scan_to_paperless/process_schema.py +++ b/scan_to_paperless/process_schema.py @@ -10,11 +10,11 @@ # # default: False "auto_level": bool, - # Min level if no level end no autolovel + # Min level if no level end no auto-level # # default: 15 "min_level": int, - # Max level if no level end no autolovel + # Max level if no level end no auto-level # # default: 15 "max_level": int, @@ -22,11 +22,11 @@ # # default: False "no_crop": bool, - # The horizontal margin used on autodetect content [mm] + # The horizontal margin used on auto-detect content [mm] # # default: 9 "margin_horizontal": Union[int, float], - # The vertical margin used on autodetect content [mm] + # The vertical margin used on auto-detect content [mm] # # default: 6 "margin_vertical": Union[int, float], @@ -101,7 +101,7 @@ # Assisted split # -# Assited split configuration +# Assisted split configuration AssistedSplit = TypedDict( "AssistedSplit", { @@ -143,7 +143,6 @@ # The ignored errors "intermediate_error": List["IntermediateError"], "images_config": Dict[str, "_ConfigurationImagesConfigAdditionalproperties"], - "images_status": Dict[str, "_ConfigurationImagesStatusAdditionalproperties"], }, total=False, ) @@ -197,20 +196,25 @@ _ConfigurationImagesConfigAdditionalproperties = TypedDict( "_ConfigurationImagesConfigAdditionalproperties", { - # The used angle to deskex, can be change, restart by deleting one of the generated images + # The used angle to deskew, can be change, restart by deleting one of the generated images "angle": Union[Union[int, float], None], + # WARNING: The required are not correctly taken in account, + # See: https://github.com/camptocamp/jsonschema-gentypes/issues/6 + "status": "_ConfigurationImagesConfigAdditionalpropertiesStatus", }, total=False, ) -_ConfigurationImagesStatusAdditionalproperties = TypedDict( - "_ConfigurationImagesStatusAdditionalproperties", +_ConfigurationImagesConfigAdditionalpropertiesStatus = TypedDict( + "_ConfigurationImagesConfigAdditionalpropertiesStatus", { # The measured deskew angle "angle": Union[int, float], # The measured deskew angle deviation "average_deviation": Union[int, float], + # The measured deskew angle deviation, corrected + "average_deviation2": Union[int, float], # The measured possible deskew angles, visible on the generated image "angles": List[Union[int, float]], # The image dimensions From 4b806fdd09eaa10acd2ca52234a5823c111b6501 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 14:10:06 +0000 Subject: [PATCH 06/32] Bump c2cciutils from 1.1.dev20210921153209 to 1.1.dev20211004113922 Bumps [c2cciutils](https://github.com/camptocamp/c2cciutils) from 1.1.dev20210921153209 to 1.1.dev20211004113922. - [Release notes](https://github.com/camptocamp/c2cciutils/releases) - [Commits](https://github.com/camptocamp/c2cciutils/commits) --- updated-dependencies: - dependency-name: c2cciutils dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index c934f5c4..2c511af9 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,2 +1,2 @@ -c2cciutils==1.1.dev20210921153209 +c2cciutils==1.1.dev20211004113922 jsonschema2md==0.2.1 From d8901f4f91e0e4af4e52316118953c1ce6f17fbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 14:25:51 +0000 Subject: [PATCH 07/32] Bump coverage from 5.5 to 6.0 --- Pipfile | 2 +- Pipfile.lock | 118 ++++++++++++++++++++++----------------------------- 2 files changed, 52 insertions(+), 68 deletions(-) diff --git a/Pipfile b/Pipfile index f6ab6faa..d4ccdd1d 100644 --- a/Pipfile +++ b/Pipfile @@ -16,7 +16,7 @@ jsonschema-gentypes = "==0.9.4" prospector = {extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "==1.5.1"} flake8 = "==3.9.2" pytest = "==6.2.5" -coverage = "==5.5" +coverage = "==6.0" pytest-profiling = "==1.7.0" argcomplete = "==1.12.3" diff --git a/Pipfile.lock b/Pipfile.lock index 2dffd49c..6d5e65c1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "06585f616680f0356477a5a55c4f15742e953e9b39d313daa126c87c6428183b" + "sha256": "a525bc9e1341dab7b4cda2bca5cc3790c9166264e857f3d6e1982ed7a8b0bc44" }, "pipfile-spec": 6, "requires": { @@ -71,10 +71,11 @@ }, "jsonschema": { "hashes": [ - "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163", - "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a" + "sha256:48f4e74f8bec0c2f75e9fcfffa264e78342873e1b57e2cfeae54864cc5e9e4dd", + "sha256:9938802041347f2c62cad2aef59e9a0826cd34584f3609db950efacb4dbf6518" ], - "version": "==3.2.0" + "markers": "python_version >= '3.7'", + "version": "==4.0.1" }, "jsonschema-gentypes": { "hashes": [ @@ -491,11 +492,11 @@ }, "urllib3": { "hashes": [ - "sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4", - "sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f" + "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", + "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.6" + "version": "==1.26.7" } }, "develop": { @@ -547,61 +548,44 @@ }, "coverage": { "hashes": [ - "sha256:004d1880bed2d97151facef49f08e255a20ceb6f9432df75f4eef018fdd5a78c", - "sha256:01d84219b5cdbfc8122223b39a954820929497a1cb1422824bb86b07b74594b6", - "sha256:040af6c32813fa3eae5305d53f18875bedd079960822ef8ec067a66dd8afcd45", - "sha256:06191eb60f8d8a5bc046f3799f8a07a2d7aefb9504b0209aff0b47298333302a", - "sha256:13034c4409db851670bc9acd836243aeee299949bd5673e11844befcb0149f03", - "sha256:13c4ee887eca0f4c5a247b75398d4114c37882658300e153113dafb1d76de529", - "sha256:184a47bbe0aa6400ed2d41d8e9ed868b8205046518c52464fde713ea06e3a74a", - "sha256:18ba8bbede96a2c3dde7b868de9dcbd55670690af0988713f0603f037848418a", - "sha256:1aa846f56c3d49205c952d8318e76ccc2ae23303351d9270ab220004c580cfe2", - "sha256:217658ec7187497e3f3ebd901afdca1af062b42cfe3e0dafea4cced3983739f6", - "sha256:24d4a7de75446be83244eabbff746d66b9240ae020ced65d060815fac3423759", - "sha256:2910f4d36a6a9b4214bb7038d537f015346f413a975d57ca6b43bf23d6563b53", - "sha256:2949cad1c5208b8298d5686d5a85b66aae46d73eec2c3e08c817dd3513e5848a", - "sha256:2a3859cb82dcbda1cfd3e6f71c27081d18aa251d20a17d87d26d4cd216fb0af4", - "sha256:2cafbbb3af0733db200c9b5f798d18953b1a304d3f86a938367de1567f4b5bff", - "sha256:2e0d881ad471768bf6e6c2bf905d183543f10098e3b3640fc029509530091502", - "sha256:30c77c1dc9f253283e34c27935fded5015f7d1abe83bc7821680ac444eaf7793", - "sha256:3487286bc29a5aa4b93a072e9592f22254291ce96a9fbc5251f566b6b7343cdb", - "sha256:372da284cfd642d8e08ef606917846fa2ee350f64994bebfbd3afb0040436905", - "sha256:41179b8a845742d1eb60449bdb2992196e211341818565abded11cfa90efb821", - "sha256:44d654437b8ddd9eee7d1eaee28b7219bec228520ff809af170488fd2fed3e2b", - "sha256:4a7697d8cb0f27399b0e393c0b90f0f1e40c82023ea4d45d22bce7032a5d7b81", - "sha256:51cb9476a3987c8967ebab3f0fe144819781fca264f57f89760037a2ea191cb0", - "sha256:52596d3d0e8bdf3af43db3e9ba8dcdaac724ba7b5ca3f6358529d56f7a166f8b", - "sha256:53194af30d5bad77fcba80e23a1441c71abfb3e01192034f8246e0d8f99528f3", - "sha256:5fec2d43a2cc6965edc0bb9e83e1e4b557f76f843a77a2496cbe719583ce8184", - "sha256:6c90e11318f0d3c436a42409f2749ee1a115cd8b067d7f14c148f1ce5574d701", - "sha256:74d881fc777ebb11c63736622b60cb9e4aee5cace591ce274fb69e582a12a61a", - "sha256:7501140f755b725495941b43347ba8a2777407fc7f250d4f5a7d2a1050ba8e82", - "sha256:796c9c3c79747146ebd278dbe1e5c5c05dd6b10cc3bcb8389dfdf844f3ead638", - "sha256:869a64f53488f40fa5b5b9dcb9e9b2962a66a87dab37790f3fcfb5144b996ef5", - "sha256:8963a499849a1fc54b35b1c9f162f4108017b2e6db2c46c1bed93a72262ed083", - "sha256:8d0a0725ad7c1a0bcd8d1b437e191107d457e2ec1084b9f190630a4fb1af78e6", - "sha256:900fbf7759501bc7807fd6638c947d7a831fc9fdf742dc10f02956ff7220fa90", - "sha256:92b017ce34b68a7d67bd6d117e6d443a9bf63a2ecf8567bb3d8c6c7bc5014465", - "sha256:970284a88b99673ccb2e4e334cfb38a10aab7cd44f7457564d11898a74b62d0a", - "sha256:972c85d205b51e30e59525694670de6a8a89691186012535f9d7dbaa230e42c3", - "sha256:9a1ef3b66e38ef8618ce5fdc7bea3d9f45f3624e2a66295eea5e57966c85909e", - "sha256:af0e781009aaf59e25c5a678122391cb0f345ac0ec272c7961dc5455e1c40066", - "sha256:b6d534e4b2ab35c9f93f46229363e17f63c53ad01330df9f2d6bd1187e5eaacf", - "sha256:b7895207b4c843c76a25ab8c1e866261bcfe27bfaa20c192de5190121770672b", - "sha256:c0891a6a97b09c1f3e073a890514d5012eb256845c451bd48f7968ef939bf4ae", - "sha256:c2723d347ab06e7ddad1a58b2a821218239249a9e4365eaff6649d31180c1669", - "sha256:d1f8bf7b90ba55699b3a5e44930e93ff0189aa27186e96071fac7dd0d06a1873", - "sha256:d1f9ce122f83b2305592c11d64f181b87153fc2c2bbd3bb4a3dde8303cfb1a6b", - "sha256:d314ed732c25d29775e84a960c3c60808b682c08d86602ec2c3008e1202e3bb6", - "sha256:d636598c8305e1f90b439dbf4f66437de4a5e3c31fdf47ad29542478c8508bbb", - "sha256:deee1077aae10d8fa88cb02c845cfba9b62c55e1183f52f6ae6a2df6a2187160", - "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c", - "sha256:f030f8873312a16414c0d8e1a1ddff2d3235655a2174e3648b4fa66b3f2f1079", - "sha256:f0b278ce10936db1a37e6954e15a3730bea96a0997c26d7fee88e6c396c2086d", - "sha256:f11642dddbb0253cc8853254301b51390ba0081750a8ac03f20ea8103f0c56b6" + "sha256:08fd55d2e00dac4c18a2fa26281076035ec86e764acdc198b9185ce749ada58f", + "sha256:11ce082eb0f7c2bbfe96f6c8bcc3a339daac57de4dc0f3186069ec5c58da911c", + "sha256:17983f6ccc47f4864fd16d20ff677782b23d1207bf222d10e4d676e4636b0872", + "sha256:25df2bc53a954ba2ccf230fa274d1de341f6aa633d857d75e5731365f7181749", + "sha256:274a612f67f931307706b60700f1e4cf80e1d79dff6c282fc9301e4565e78724", + "sha256:3dfb23cc180b674a11a559183dff9655beb9da03088f3fe3c4f3a6d200c86f05", + "sha256:43bada49697a62ffa0283c7f01bbc76aac562c37d4bb6c45d56dd008d841194e", + "sha256:4865dc4a7a566147cbdc2b2f033a6cccc99a7dcc89995137765c384f6c73110b", + "sha256:581fddd2f883379bd5af51da9233e0396b6519f3d3eeae4fb88867473be6d56e", + "sha256:5c191e01b23e760338f19d8ba2470c0dad44c8b45e41ac043b2db84efc62f695", + "sha256:6e216e4021c934246c308fd3e0d739d9fa8a3f4ea414f584ab90ef9c1592f282", + "sha256:72f8c99f1527c5a8ee77c890ea810e26b39fd0b4c2dffc062e20a05b2cca60ef", + "sha256:7593a49300489d064ebb6c58539f52cbbc4a2e6a4385de5e92cae1563f88a425", + "sha256:7844a8c6a0fee401edbf578713c2473e020759267c40261b294036f9d3eb6a2d", + "sha256:7af2f8e7bb54ace984de790e897f858e88068d8fbc46c9490b7c19c59cf51822", + "sha256:7dbda34e8e26bd86606ba8a9c13ccb114802e01758a3d0a75652ffc59a573220", + "sha256:82b58d37c47d93a171be9b5744bcc96a0012cbf53d5622b29a49e6be2097edd7", + "sha256:8305e14112efb74d0b5fec4df6e41cafde615c2392a7e51c84013cafe945842c", + "sha256:8426fec5ad5a6e8217921716b504e9b6e1166dc147e8443b4855e329db686282", + "sha256:88f1810eb942e7063d051d87aaaa113eb5fd5a7fd2cda03a972de57695b8bb1a", + "sha256:8da0c4a26a831b392deaba5fdd0cd7838d173b47ce2ec3d0f37be630cb09ef6e", + "sha256:a9dbfcbc56d8de5580483cf2caff6a59c64d3e88836cbe5fb5c20c05c29a8808", + "sha256:aa5d4d43fa18cc9d0c6e02a83de0b9729b5451a9066574bd276481474f0a53ab", + "sha256:adb0f4c3c8ba8104378518a1954cbf3d891a22c13fd0e0bf135391835f44f288", + "sha256:b4ee5815c776dfa3958ba71c7cd4cdd8eb40d79358a18352feb19562fe4408c4", + "sha256:b5dd5ae0a9cd55d71f1335c331e9625382239b8cede818fb62d8d2702336dbf8", + "sha256:b78dd3eeb8f5ff26d2113c41836bac04a9ea91be54c346826b54a373133c8c53", + "sha256:bea681309bdd88dd1283a8ba834632c43da376d9bce05820826090aad80c0126", + "sha256:befb5ffa9faabef6dadc42622c73de168001425258f0b7e402a2934574e7a04b", + "sha256:d795a2c92fe8cb31f6e9cd627ee4f39b64eb66bf47d89d8fcf7cb3d17031c887", + "sha256:d82cbef1220703ce56822be7fbddb40736fc1a928ac893472df8aff7421ae0aa", + "sha256:e63490e8a6675cee7a71393ee074586f7eeaf0e9341afd006c5d6f7eec7c16d7", + "sha256:e735ab8547d8a1fe8e58dd765d6f27ac539b395f52160d767b7189f379f9be7a", + "sha256:fa816e97cfe1f691423078dffa39a18106c176f28008db017b3ce3e947c34aa5", + "sha256:fff04bfefb879edcf616f1ce5ea6f4a693b5976bdc5e163f8464f349c25b59f0" ], "index": "pypi", - "version": "==5.5" + "version": "==6.0" }, "docutils": { "hashes": [ @@ -675,7 +659,7 @@ "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899", "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2" ], - "markers": "python_version < '4.0' and python_full_version >= '3.6.1'", + "markers": "python_version < '4' and python_full_version >= '3.6.1'", "version": "==5.9.3" }, "lazy-object-proxy": { @@ -773,11 +757,11 @@ }, "platformdirs": { "hashes": [ - "sha256:15b056538719b1c94bdaccb29e5f81879c7f7f0f4a153f46086d155dffcd4f0f", - "sha256:8003ac87717ae2c7ee1ea5a84a1a61e87f3fbd16eb5aadba194ea30a9019f648" + "sha256:367a5e80b3d04d2428ffa76d33f124cf11e8fff2acdaa9b43d545f5c7d661ef2", + "sha256:8868bbe3c3c80d42f20156f22e7131d2fb321f5bc86a2a345375c6481a67021d" ], "markers": "python_version >= '3.6'", - "version": "==2.3.0" + "version": "==2.4.0" }, "pluggy": { "hashes": [ @@ -1013,11 +997,11 @@ }, "urllib3": { "hashes": [ - "sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4", - "sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f" + "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", + "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.6" + "version": "==1.26.7" }, "wrapt": { "hashes": [ From 07e26cff8659e154f46053465bd7aac1e585d9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 4 Oct 2021 17:40:09 +0200 Subject: [PATCH 08/32] Fix checks --- .prospector.yaml | 7 ++ scan_to_paperless/__init__.py | 2 + scan_to_paperless/config_old.py | 2 + scan_to_paperless/process.py | 91 +++++++++++++++++++++--- scan_to_paperless/scan.py | 5 ++ scan_to_paperless/scan_process_status.py | 3 + setup.py | 2 + tests/test_process.py | 8 +-- 8 files changed, 105 insertions(+), 15 deletions(-) diff --git a/.prospector.yaml b/.prospector.yaml index bac23205..4380a07f 100644 --- a/.prospector.yaml +++ b/.prospector.yaml @@ -1,5 +1,7 @@ --- strictness: veryhigh +doc-warnings: true +max-line-length: 110 ignore-paths: - scan_to_paperless/process_schema.py @@ -9,6 +11,11 @@ pep8: disable: - E203 # whitespace before ':' +pep257: + disable: + - D212 # Multi-line docstring summary should start at the first line + - D203 # 1 blank line required before class docstring (found 0), not compatible with Black + pylint: disable: - wrong-import-order diff --git a/scan_to_paperless/__init__.py b/scan_to_paperless/__init__.py index bb5fc091..94aa9e96 100644 --- a/scan_to_paperless/__init__.py +++ b/scan_to_paperless/__init__.py @@ -1,3 +1,4 @@ +"""The scan to Paperless main module.""" import os.path import sys from typing import cast @@ -22,6 +23,7 @@ def get_config(config_filename: str) -> stp_config.Configuration: + """Get the configuration.""" if os.path.exists(config_filename): yaml = YAML() yaml.default_flow_style = False diff --git a/scan_to_paperless/config_old.py b/scan_to_paperless/config_old.py index d54efcbb..a4f18696 100644 --- a/scan_to_paperless/config_old.py +++ b/scan_to_paperless/config_old.py @@ -1,3 +1,5 @@ +"""Config for old Python versions.""" + from typing import Any, Dict # Arguments diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 9af0b6a6..004c1448 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +"""Process the scanned documents.""" + import argparse import glob import math @@ -36,6 +38,7 @@ def rotate_image( image: np_ndarray_int, angle: float, background: Union[int, Tuple[int, int, int]] ) -> np_ndarray_int: + """Rotate the image.""" old_width, old_height = image.shape[:2] angle_radian = math.radians(angle) width = abs(np.sin(angle_radian) * old_height) + abs(np.cos(angle_radian) * old_width) @@ -59,6 +62,7 @@ def crop_image( # pylint: disable=too-many-arguments height: int, background: Union[Tuple[int], Tuple[int, int, int]], ) -> np_ndarray_int: + """Crop the image.""" matrice = np.array([[1.0, 0.0, -x], [0.0, 1.0, -y]]) return cast( np_ndarray_int, @@ -67,6 +71,8 @@ def crop_image( # pylint: disable=too-many-arguments class Context: # pylint: disable=too-many-instance-attributes + """All the context of the current image with his mask.""" + def __init__( # pylint: disable=too-many-arguments self, config: scan_to_paperless.process_schema.Configuration, @@ -75,6 +81,7 @@ def __init__( # pylint: disable=too-many-arguments root_folder: Optional[str] = None, image_name: Optional[str] = None, ) -> None: + """Initialize.""" self.config = config self.step = step self.config_file_name = config_file_name @@ -86,6 +93,7 @@ def __init__( # pylint: disable=too-many-arguments self.process_count = self.step.get("process_count", 0) def init_mask(self) -> None: + """Init the mask.""" if self.image is None: raise Exception("The image is None") if self.mask is None: @@ -95,12 +103,14 @@ def init_mask(self) -> None: ) def get_process_count(self) -> int: + """Get the step number.""" try: return self.process_count finally: self.process_count += 1 def get_masked(self) -> np_ndarray_int: + """Get the mask.""" if self.image is None: raise Exception("The image is None") if self.mask_ready is None: @@ -111,6 +121,7 @@ def get_masked(self) -> np_ndarray_int: return image def crop(self, x: int, y: int, width: int, height: int) -> None: + """Crop the image.""" if self.image is None: raise Exception("The image is None") self.image = crop_image(self.image, x, y, width, height, (255, 255, 255)) @@ -118,6 +129,7 @@ def crop(self, x: int, y: int, width: int, height: int) -> None: self.mask_ready = crop_image(self.mask_ready, x, y, width, height, (0,)) def rotate(self, angle: float) -> None: + """Rotate the image.""" if self.image is None: raise Exception("The image is None") self.image = rotate_image(self.image, angle, (255, 255, 255)) @@ -125,6 +137,7 @@ def rotate(self, angle: float) -> None: self.mask_ready = rotate_image(self.mask_ready, angle, 0) def get_px_value(self, name: str, default: Union[int, float]) -> float: + """Get the value in px.""" return ( cast(float, self.config["args"].get(name, default)) / 10 @@ -139,6 +152,7 @@ def add_intermediate_error( error: Exception, traceback_: List[str], ) -> None: + """Add in the config non fatal error.""" if config_file_name is None: raise Exception("The config file name is required") if "intermediate_error" not in config: @@ -162,6 +176,7 @@ def add_intermediate_error( def call(cmd: Union[str, List[str]], **kwargs: Any) -> None: + """Verbose version of check_output with no returns.""" if isinstance(cmd, list): cmd = [str(element) for element in cmd] print(" ".join(cmd) if isinstance(cmd, list) else cmd) @@ -170,6 +185,7 @@ def call(cmd: Union[str, List[str]], **kwargs: Any) -> None: def output(cmd: Union[str, List[str]], **kwargs: Any) -> str: + """Verbose version of check_output.""" if isinstance(cmd, list): cmd = [str(element) for element in cmd] print(" ".join(cmd) if isinstance(cmd, list) else cmd) @@ -178,6 +194,7 @@ def output(cmd: Union[str, List[str]], **kwargs: Any) -> str: def image_diff(image1: np_ndarray_int, image2: np_ndarray_int) -> Tuple[float, np_ndarray_int]: + """Do a diff between images.""" width = max(image1.shape[1], image2.shape[1]) height = max(image1.shape[0], image2.shape[0]) image1 = cv2.resize(image1, (width, height)) @@ -193,16 +210,22 @@ def image_diff(image1: np_ndarray_int, image2: np_ndarray_int) -> Tuple[float, n from typing_extensions import Protocol class FunctionWithContextReturnsImage(Protocol): + """Function with context and returns an image.""" + def __call__(self, context: Context) -> Optional[np_ndarray_int]: - pass + """Call the function.""" class FunctionWithContextReturnsNone(Protocol): + """Function with context and no return.""" + def __call__(self, context: Context) -> None: - pass + """Call the function.""" class ExternalFunction(Protocol): + """Function that call an external tool.""" + def __call__(self, context: Context, source: str, destination: str) -> None: - pass + """Call the function.""" else: @@ -211,13 +234,23 @@ def __call__(self, context: Context, source: str, destination: str) -> None: ExternalFunction = Any +# Decorate a step of the transform class Process: # pylint: disable=too-few-public-methods + """ + Encapulate a transform function. + + To save the process image when needed. + """ + def __init__(self, name: str, experimental: bool = False, ignore_error: bool = False) -> None: + """Initialize.""" self.experimental = experimental self.name = name self.ignore_error = ignore_error def __call__(self, func: FunctionWithContextReturnsImage) -> FunctionWithContextReturnsNone: + """Call the function.""" + def wrapper(context: Context) -> None: if context.image is None: raise Exception("The image is required") @@ -288,6 +321,8 @@ def wrapper(context: Context) -> None: def external(func: ExternalFunction) -> FunctionWithContextReturnsImage: + """Run an external tool.""" + def wrapper(context: Context) -> Optional[np_ndarray_int]: with tempfile.NamedTemporaryFile(suffix=".png") as source: cv2.imwrite(source.name, context.image) @@ -301,6 +336,7 @@ def wrapper(context: Context) -> Optional[np_ndarray_int]: def get_contour_to_crop( contours: List[Tuple[int, int, int, int]], margin_horizontal: int = 0, margin_vertical: int = 0 ) -> Tuple[int, int, int, int]: + """Get the contour to crop.""" content = [ contours[0][0], contours[0][1], @@ -323,6 +359,8 @@ def get_contour_to_crop( def crop(context: Context, margin_horizontal: int, margin_vertical: int) -> None: """ + Do a crop on an image. + Margin in px """ image = context.get_masked() @@ -355,6 +393,7 @@ def crop(context: Context, margin_horizontal: int, margin_vertical: int) -> None @Process("level") def level(context: Context) -> np_ndarray_int: + """Do the level on an image.""" img_yuv = cv2.cvtColor(context.image, cv2.COLOR_BGR2YUV) if context.config["args"].get("auto_level"): @@ -386,6 +425,7 @@ def level(context: Context) -> np_ndarray_int: def draw_angle(image: np_ndarray_int, angle: float, color: Tuple[int, int, int]) -> None: + """Draw an angle on the image (as a line passed at the center of the image).""" angle = angle % 90 height, width = image.shape[:2] center = (int(width / 2), int(height / 2)) @@ -405,11 +445,13 @@ def draw_angle(image: np_ndarray_int, angle: float, color: Tuple[int, int, int]) def nice_angle(angle: float) -> float: + """Fix the angle to be between -45° and 45°.""" return ((angle + 45) % 90) - 45 @Process("deskew") def deskew(context: Context) -> None: + """Deskew an image.""" images_config = context.config.setdefault("images_config", {}) assert context.image_name image_config = images_config.setdefault(context.image_name, {}) @@ -448,6 +490,7 @@ def deskew(context: Context) -> None: @Process("docrop") def docrop(context: Context) -> None: + """Crop an image.""" # Margin in mm if context.config["args"].get("no_crop", False): return @@ -458,6 +501,7 @@ def docrop(context: Context) -> None: @Process("sharpen") def sharpen(context: Context) -> Optional[np_ndarray_int]: + """Sharpen an image.""" if context.config["args"].get("sharpen", False) is False: return None if context.image is None: @@ -469,6 +513,7 @@ def sharpen(context: Context) -> Optional[np_ndarray_int]: @Process("dither") @external def dither(context: Context, source: str, destination: str) -> None: + """Dither an image.""" if context.config["args"].get("dither", False) is False: return call(CONVERT + ["+dither", source, destination]) @@ -476,6 +521,11 @@ def dither(context: Context, source: str, destination: str) -> None: @Process("autorotate", False, True) def autorotate(context: Context) -> None: + """ + Auto rotate an image. + + Put the text in the right position. + """ with tempfile.NamedTemporaryFile(suffix=".png") as source: cv2.imwrite(source.name, context.get_masked()) orientation_lst = output(["tesseract", source.name, "-", "--psm", "0", "-l", "osd"]).splitlines() @@ -486,6 +536,7 @@ def autorotate(context: Context) -> None: def draw_line( # pylint: disable=too-many-arguments image: np_ndarray_int, vertical: bool, position: float, value: int, name: str, type_: str ) -> scan_to_paperless.process_schema.Limit: + """Draw a line on an image.""" img_len = image.shape[0 if vertical else 1] color = (255, 0, 0) if vertical else (0, 255, 0) if vertical: @@ -498,6 +549,7 @@ def draw_line( # pylint: disable=too-many-arguments def draw_rectangle(image: np_ndarray_int, contour: Tuple[int, int, int, int]) -> None: + """Draw a rectangle on an image.""" color = (0, 255, 0) x, y, width, height = contour x = int(round(x)) @@ -511,6 +563,7 @@ def draw_rectangle(image: np_ndarray_int, contour: Tuple[int, int, int, int]) -> def find_lines(image: np_ndarray_int, vertical: bool) -> Tuple[np_ndarray_int, Dict[str, np_ndarray_int]]: + """Find the lines on an image.""" gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) edges = cv2.Canny(gray, 50, 150, apertureSize=3) lines = cv2.HoughLinesP( @@ -540,7 +593,7 @@ def find_lines(image: np_ndarray_int, vertical: bool) -> Tuple[np_ndarray_int, D def zero_ranges(values: np_ndarray_int) -> np_ndarray_int: - # Create an array that is 1 where a is 0, and pad each end with an extra 0. + """Create an array that is 1 where a is 0, and pad each end with an extra 0.""" iszero = np.concatenate(([0], np.equal(values, 0).view(np.int8), [0])) # type: ignore absdiff = np.abs(np.diff(iszero)) # type: ignore # Runs start and end where absdiff is 1. @@ -558,6 +611,7 @@ def find_limit_contour( block_size: Union[float, int] = 16, threshold_value_c: Union[float, int] = 100, ) -> Tuple[List[int], List[Tuple[int, int, int, int]]]: + """Find the contour for assisted split.""" contours = find_contours( image, name, min_box_size, min_box_black, kernel_size, block_size, threshold_value_c ) @@ -582,6 +636,7 @@ def find_limit_contour( def fill_limits( image: np_ndarray_int, vertical: bool, context: Context ) -> List[scan_to_paperless.process_schema.Limit]: + """Find the limit for assisted split.""" peaks, properties = find_lines(image, vertical) contours_limits, contours = find_limit_contour( image, @@ -623,6 +678,7 @@ def find_contours( block_size: Union[float, int] = 16, threshold_value_c: Union[float, int] = 100, ) -> List[Tuple[int, int, int, int]]: + """Find the contours on an image.""" gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) block_size = int(round(block_size / 2) * 2) kernel_size = int(round(kernel_size / 2)) @@ -662,6 +718,7 @@ def find_contours( @Process("tesseract", True) @external def tesseract(context: Context, source: str, destination: str) -> None: + """Run tesseract on an image.""" del context call(f"tesseract -l fra+eng {source} stdout pdf > {destination}", shell=True) # nosec @@ -672,6 +729,7 @@ def transform( config_file_name: str, root_folder: str, ) -> scan_to_paperless.process_schema.Step: + """Apply the transforms on a document.""" if "intermediate_error" in config: del config["intermediate_error"] @@ -760,6 +818,7 @@ def transform( def save(root_folder: str, img: str, folder: str, force: bool = False) -> str: + """Save the current image in a subfolder if progress mode in enabled.""" if force or os.environ.get("PROGRESS") == "TRUE": dest_folder = os.path.join(root_folder, folder) if not os.path.exists(dest_folder): @@ -773,6 +832,7 @@ def save(root_folder: str, img: str, folder: str, force: bool = False) -> str: def save_image( image: np_ndarray_int, root_folder: str, folder: str, name: str, force: bool = False ) -> Optional[str]: + """Save an image.""" if force or os.environ.get("PROGRESS") == "TRUE": dest_folder = os.path.join(root_folder, folder) if not os.path.exists(dest_folder): @@ -784,6 +844,12 @@ def save_image( class Item(TypedDict, total=False): + """ + Image content and position. + + Used to create the final document + """ + pos: int file: IO[bytes] @@ -793,6 +859,7 @@ def split( step: scan_to_paperless.process_schema.Step, root_folder: str, ) -> scan_to_paperless.process_schema.Step: + """Split an image using the assisted split instructions.""" process_count = 0 for assisted_split in config["assisted_split"]: if assisted_split["limits"]: @@ -924,15 +991,16 @@ def split( return {"sources": transformed_images, "name": "finalise", "process_count": process_count} -def finalise( +def finalize( config: scan_to_paperless.process_schema.Configuration, step: scan_to_paperless.process_schema.Step, root_folder: str, ) -> None: """ - Final step on document generation (convert in one pdf and copy with the right name in the cusume folder) - """ + Do final step on document generation. + convert in one pdf and copy with the right name in the consume folder + """ destination = config["destination"] if os.path.exists(destination): @@ -976,6 +1044,7 @@ def finalise( def write_error(root_folder: str, message: str) -> None: + """Write the exception in an error file.""" if not os.path.exists(os.path.join(root_folder, "error.yaml")): yaml = YAML(typ="safe") yaml.default_flow_style = False @@ -984,6 +1053,7 @@ def write_error(root_folder: str, message: str) -> None: def is_sources_present(images: List[str], root_folder: str) -> bool: + """Are sources present for the next step.""" for img in images: if not os.path.exists(os.path.join(root_folder, img)): print(f"Missing {root_folder} - {img}") @@ -992,6 +1062,7 @@ def is_sources_present(images: List[str], root_folder: str) -> bool: def save_config(config: scan_to_paperless.process_schema.Configuration, config_file_name: str) -> None: + """Save the configuration.""" yaml = YAML() yaml.default_flow_style = False with open(config_file_name + "_", "w", encoding="utf-8") as config_file: @@ -1000,9 +1071,7 @@ def save_config(config: scan_to_paperless.process_schema.Configuration, config_f def main() -> None: - """ - Main function - """ + """Process the scanned documents.""" parser = argparse.ArgumentParser() parser.add_argument("--folder", default="/source", help="The folder to be processed") args = parser.parse_args() @@ -1076,7 +1145,7 @@ def main() -> None: next_step = split(config, step, root_folder) elif step["name"] == "finalise": print("Finalise") - finalise(config, step, root_folder) + finalize(config, step, root_folder) done = True if done and os.environ.get("PROGRESS", "FALSE") != "TRUE": diff --git a/scan_to_paperless/scan.py b/scan_to_paperless/scan.py index 51bb08a5..a21fba97 100755 --- a/scan_to_paperless/scan.py +++ b/scan_to_paperless/scan.py @@ -1,3 +1,5 @@ +"""Scan a new document.""" + import argparse import glob import os @@ -21,6 +23,7 @@ def call(cmd: List[str], cmd2: Optional[List[str]] = None, **kwargs: Any) -> None: + """Verbose implementation of check_call.""" del cmd2 print(" ".join(cmd) if isinstance(cmd, list) else cmd) try: @@ -31,6 +34,7 @@ def call(cmd: List[str], cmd2: Optional[List[str]] = None, **kwargs: Any) -> Non def output(cmd: List[str], cmd2: Optional[List[str]] = None, **kwargs: Any) -> bytes: + """Verbose implementation of check_output.""" del cmd2 print(" ".join(cmd) if isinstance(cmd, list) else cmd) try: @@ -41,6 +45,7 @@ def output(cmd: List[str], cmd2: Optional[List[str]] = None, **kwargs: Any) -> b def main() -> None: + """Scan a new document.""" parser = argparse.ArgumentParser() presets = [e[len(CONFIG_PATH) - 4 : -5] for e in glob.glob(f"{CONFIG_PATH[:-5]}-*.yaml")] # noqa diff --git a/scan_to_paperless/scan_process_status.py b/scan_to_paperless/scan_process_status.py index 6a96ff50..08d8bbfb 100755 --- a/scan_to_paperless/scan_process_status.py +++ b/scan_to_paperless/scan_process_status.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +"""Get the status of current scan.""" + import glob import os import re @@ -12,6 +14,7 @@ def main() -> None: + """Get the status of current scan.""" config = get_config(CONFIG_PATH) for folder in glob.glob(os.path.join(os.path.expanduser(config["scan_folder"]), "*")): print(re.sub(r".", "-", folder)) diff --git a/setup.py b/setup.py index b4e99835..126aee8e 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +"""Scan to paperlass package.""" + import os import site import sys diff --git a/tests/test_process.py b/tests/test_process.py index 7c291a09..a5869327 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -138,7 +138,7 @@ def test_assisted_split_full(type_, limit): assert step["name"] == "finalise" check_image_file(root_folder, step["sources"][0], f"assisted-split-{type_}-3") check_image_file(root_folder, step["sources"][1], f"assisted-split-{type_}-4") - process.finalise(config, step, root_folder) + process.finalize(config, step, root_folder) pdfinfo = process.output(["pdfinfo", os.path.join(root_folder, "final.pdf")]).split("\n") regex = re.compile(r"([a-zA-Z ]+): +(.*)") pdfinfo = [regex.match(e) for e in pdfinfo] @@ -202,7 +202,7 @@ def test_assisted_split_join_full(): assert len(step["sources"]) == 1 check_image_file(root_folder, step["sources"][0], "assisted-split-join-1") - process.finalise(config, step, root_folder) + process.finalize(config, step, root_folder) pdfinfo = process.output(["pdfinfo", os.path.join(root_folder, "final.pdf")]).split("\n") regex = re.compile(r"([a-zA-Z ]+): +(.*)") pdfinfo = [regex.match(e) for e in pdfinfo] @@ -302,7 +302,7 @@ def test_full(progress, experimental): assert not os.path.exists(os.path.join(root_folder, "tesseract")) assert step["name"] == "finalise" - process.finalise(config, step, root_folder) + process.finalize(config, step, root_folder) pdfinfo = process.output(["pdfinfo", os.path.join(root_folder, "final.pdf")]).split("\n") regex = re.compile(r"([a-zA-Z ]+): +(.*)") pdfinfo = [regex.match(e) for e in pdfinfo] @@ -344,7 +344,7 @@ def test_credit_card_full(): step = process.transform(config, step, "/tmp/test-config.yaml", root_folder) assert len(step["sources"]) == 2 assert step["name"] == "finalise" - process.finalise(config, step, root_folder) + process.finalize(config, step, root_folder) pdfinfo = process.output(["pdfinfo", os.path.join(root_folder, "final.pdf")]).split("\n") regex = re.compile(r"([a-zA-Z ]+): +(.*)") pdfinfo = [regex.match(e) for e in pdfinfo] From 6a44af72f78066a80a855bba24921a92240a752d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Oct 2021 07:17:48 +0000 Subject: [PATCH 09/32] Bump c2cciutils from 1.1.dev20211004113922 to 1.1.dev20211006140719 --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index 2c511af9..38a0166d 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,2 +1,2 @@ -c2cciutils==1.1.dev20211004113922 +c2cciutils==1.1.dev20211006140719 jsonschema2md==0.2.1 From eafaef9d75f50d2f63c73ba04a8e473640c3b463 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Oct 2021 14:15:54 +0000 Subject: [PATCH 10/32] Bump coverage from 6.0 to 6.0.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.0 to 6.0.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/6.0...6.0.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Pipfile | 2 +- Pipfile.lock | 78 +++++++++++++++++++++++++--------------------------- 2 files changed, 39 insertions(+), 41 deletions(-) diff --git a/Pipfile b/Pipfile index d4ccdd1d..f877e6b9 100644 --- a/Pipfile +++ b/Pipfile @@ -16,7 +16,7 @@ jsonschema-gentypes = "==0.9.4" prospector = {extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "==1.5.1"} flake8 = "==3.9.2" pytest = "==6.2.5" -coverage = "==6.0" +coverage = "==6.0.1" pytest-profiling = "==1.7.0" argcomplete = "==1.12.3" diff --git a/Pipfile.lock b/Pipfile.lock index 6d5e65c1..04f817dc 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "a525bc9e1341dab7b4cda2bca5cc3790c9166264e857f3d6e1982ed7a8b0bc44" + "sha256": "3b7950f6b8fe154662c690c91d619ed4f9bed26bcc70221343fe9d0156fca356" }, "pipfile-spec": 6, "requires": { @@ -510,11 +510,11 @@ }, "astroid": { "hashes": [ - "sha256:dcc06f6165f415220013801642bd6c9808a02967070919c4b746c6864c205471", - "sha256:fe81f80c0b35264acb5653302ffbd935d394f1775c5e4487df745bf9c2442708" + "sha256:304e99c129794f2cfda584a12b71fde85205da950e2f330f4be09150525ae949", + "sha256:9eaeaf92b3e21b70bec1a262e7eb118d2e96294892a5de595c92a12adc80dfc2" ], "markers": "python_version ~= '3.6'", - "version": "==2.8.0" + "version": "==2.8.2" }, "attrs": { "hashes": [ @@ -548,44 +548,42 @@ }, "coverage": { "hashes": [ - "sha256:08fd55d2e00dac4c18a2fa26281076035ec86e764acdc198b9185ce749ada58f", - "sha256:11ce082eb0f7c2bbfe96f6c8bcc3a339daac57de4dc0f3186069ec5c58da911c", - "sha256:17983f6ccc47f4864fd16d20ff677782b23d1207bf222d10e4d676e4636b0872", - "sha256:25df2bc53a954ba2ccf230fa274d1de341f6aa633d857d75e5731365f7181749", - "sha256:274a612f67f931307706b60700f1e4cf80e1d79dff6c282fc9301e4565e78724", - "sha256:3dfb23cc180b674a11a559183dff9655beb9da03088f3fe3c4f3a6d200c86f05", - "sha256:43bada49697a62ffa0283c7f01bbc76aac562c37d4bb6c45d56dd008d841194e", - "sha256:4865dc4a7a566147cbdc2b2f033a6cccc99a7dcc89995137765c384f6c73110b", - "sha256:581fddd2f883379bd5af51da9233e0396b6519f3d3eeae4fb88867473be6d56e", - "sha256:5c191e01b23e760338f19d8ba2470c0dad44c8b45e41ac043b2db84efc62f695", - "sha256:6e216e4021c934246c308fd3e0d739d9fa8a3f4ea414f584ab90ef9c1592f282", - "sha256:72f8c99f1527c5a8ee77c890ea810e26b39fd0b4c2dffc062e20a05b2cca60ef", - "sha256:7593a49300489d064ebb6c58539f52cbbc4a2e6a4385de5e92cae1563f88a425", - "sha256:7844a8c6a0fee401edbf578713c2473e020759267c40261b294036f9d3eb6a2d", - "sha256:7af2f8e7bb54ace984de790e897f858e88068d8fbc46c9490b7c19c59cf51822", - "sha256:7dbda34e8e26bd86606ba8a9c13ccb114802e01758a3d0a75652ffc59a573220", - "sha256:82b58d37c47d93a171be9b5744bcc96a0012cbf53d5622b29a49e6be2097edd7", - "sha256:8305e14112efb74d0b5fec4df6e41cafde615c2392a7e51c84013cafe945842c", - "sha256:8426fec5ad5a6e8217921716b504e9b6e1166dc147e8443b4855e329db686282", - "sha256:88f1810eb942e7063d051d87aaaa113eb5fd5a7fd2cda03a972de57695b8bb1a", - "sha256:8da0c4a26a831b392deaba5fdd0cd7838d173b47ce2ec3d0f37be630cb09ef6e", - "sha256:a9dbfcbc56d8de5580483cf2caff6a59c64d3e88836cbe5fb5c20c05c29a8808", - "sha256:aa5d4d43fa18cc9d0c6e02a83de0b9729b5451a9066574bd276481474f0a53ab", - "sha256:adb0f4c3c8ba8104378518a1954cbf3d891a22c13fd0e0bf135391835f44f288", - "sha256:b4ee5815c776dfa3958ba71c7cd4cdd8eb40d79358a18352feb19562fe4408c4", - "sha256:b5dd5ae0a9cd55d71f1335c331e9625382239b8cede818fb62d8d2702336dbf8", - "sha256:b78dd3eeb8f5ff26d2113c41836bac04a9ea91be54c346826b54a373133c8c53", - "sha256:bea681309bdd88dd1283a8ba834632c43da376d9bce05820826090aad80c0126", - "sha256:befb5ffa9faabef6dadc42622c73de168001425258f0b7e402a2934574e7a04b", - "sha256:d795a2c92fe8cb31f6e9cd627ee4f39b64eb66bf47d89d8fcf7cb3d17031c887", - "sha256:d82cbef1220703ce56822be7fbddb40736fc1a928ac893472df8aff7421ae0aa", - "sha256:e63490e8a6675cee7a71393ee074586f7eeaf0e9341afd006c5d6f7eec7c16d7", - "sha256:e735ab8547d8a1fe8e58dd765d6f27ac539b395f52160d767b7189f379f9be7a", - "sha256:fa816e97cfe1f691423078dffa39a18106c176f28008db017b3ce3e947c34aa5", - "sha256:fff04bfefb879edcf616f1ce5ea6f4a693b5976bdc5e163f8464f349c25b59f0" + "sha256:07efe1fbd72e67df026ad5109bcd216acbbd4a29d5208b3dab61779bae6b7b26", + "sha256:0898d6948b31df13391cd40568de8f35fa5901bc922c5ae05cf070587cb9c666", + "sha256:0a7e55cc9f7efa22d5cc9966276ec7a40a8803676f6ccbfdc06a486fba9aa9ee", + "sha256:17426808e8e0824f864876312d41961223bf5e503bf8f1f846735279a60ea345", + "sha256:1770d24f45f1f2daeae34cfa3b33fcb29702153544cd2ad40d58399dd4ff53b5", + "sha256:1864bdf9b2ccb43e724051bc23a1c558daf101ad4488ede1945f2a8be1facdad", + "sha256:2c5f39d1556e75fc3c4fb071f9e7cfa618895a999a0de763a541d730775d0d5f", + "sha256:3490ff6dbf3f7accf0750136ed60ae1f487bccc1f097740e3b21262bc9c89854", + "sha256:353a50f123f0185cdb7a1e1e3e2cfb9d1fd7e293cfaf68eedaf5bd8e02e3ec32", + "sha256:3edbb3ec580c73e5a264f5d04f30245bc98eff1a26765d46c5c65134f0a0e2f7", + "sha256:4eb9cd910ca8e243f930243a9940ea1a522e32435d15668445753d087c30ee12", + "sha256:5b06f4f1729e2963281d9cd6e65e6976bf27b44d4c07ac5b47223ce45f822cec", + "sha256:5b1ceacb86e0a9558061dcc6baae865ed25933ea57effea644f21657cdce19bc", + "sha256:65da6e3e8325291f012921bbf71fea0a97824e1c573981871096aac6e2cf0ec5", + "sha256:66fe33e9e0df58675e08e83fe257f89e7f625e7633ea93d0872154e09cce2724", + "sha256:6873f3f954d3e3ab8b1881f4e5307cc19f70c9f931c41048d9f7e6fd946eabe7", + "sha256:73880a80fad0597eca43e213e5e1711bf6c0fcdb7eb6b01b3b17841ebe5a7f8d", + "sha256:7600fac458f74c68b097379f76f3a6e3a630493fc7fc94b6508fedd9d498c194", + "sha256:83682b73785d2e078e0b5f63410b8125b122e1a22422640c57edd4011c950f3e", + "sha256:83faa3692e8306b20293889714fdf573d10ef5efc5843bd7c7aea6971487bd6a", + "sha256:9c416ba03844608f45661a5b48dc59c6b5e89956efe388564dd138ca8caf540b", + "sha256:9d242a2434801ef5125330deddb4cddba8990c9a49b3dec99dca17dd7eefba5a", + "sha256:a2e15ab5afbee34abf716fece80ea33ea09a82e7450512f022723b1a82ec9a4e", + "sha256:abe8207dfb8a61ded9cd830d26c1073c8218fc0ae17eb899cfe8ec0fafae6e22", + "sha256:ad7182a82843f9f85487f44567c8c688f16c906bdb8d0e44ae462aed61cb8f1b", + "sha256:b45f89a8ef65c29195f8f28dbe215f44ccb29d934f3e862d2a5c12e38698a793", + "sha256:b81a4e667c45b13658b84f9b8f1d32ef86d5405fabcbd181b76b9e51d295f397", + "sha256:c9c413c4397d4cdc7ca89286158d240ce524f9667b52c9a64dd7e13d16cf8815", + "sha256:e11cca9eb5c9b3eaad899728ee2ce916138399ee8cbbccaadc1871fecb750827", + "sha256:e66c50f0ab445fec920a9f084914ea1776a809e3016c3738519048195f851bbb", + "sha256:ea452a2d83964d08232ade470091015e7ab9b8f53acbec10f2210fbab4ce7e43", + "sha256:f398d38e6ebc2637863db1d7be3d4f9c5174e7d24bb3b0716cdb1f204669cbcf", + "sha256:f82a17f2a77958f3eef40ad385fc82d4c6ba9a77a51a174efe03ce75daebbc16" ], "index": "pypi", - "version": "==6.0" + "version": "==6.0.1" }, "docutils": { "hashes": [ From f7ad9306eb918a8bf146323f82e9bffe9e0121c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Oct 2021 14:16:47 +0000 Subject: [PATCH 11/32] Bump c2cciutils from 1.1.dev20211006140719 to 1.1.dev20211007121148 --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index 38a0166d..0c1ff193 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,2 +1,2 @@ -c2cciutils==1.1.dev20211006140719 +c2cciutils==1.1.dev20211007121148 jsonschema2md==0.2.1 From 92e63e67e19a06cd84626b5bdcf839adc1d71a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 7 Oct 2021 16:38:15 +0200 Subject: [PATCH 12/32] Fix type --- scan_to_paperless/process.py | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 004c1448..5430f8a3 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -27,17 +27,17 @@ import scan_to_paperless.process_schema if TYPE_CHECKING: - np_ndarray_int = np.ndarray[None, np.dtype[np.uint8]] # pylint: disable=unsubscriptable-object + NpNdarrayInt = np.ndarray[np.uint8, Any] else: - np_ndarray_int = np.ndarray # pylint: disable=invalid-name + NpNdarrayInt = np.ndarray # dither, crop, append, repage CONVERT = ["gm", "convert"] def rotate_image( - image: np_ndarray_int, angle: float, background: Union[int, Tuple[int, int, int]] -) -> np_ndarray_int: + image: NpNdarrayInt, angle: float, background: Union[int, Tuple[int, int, int]] +) -> NpNdarrayInt: """Rotate the image.""" old_width, old_height = image.shape[:2] angle_radian = math.radians(angle) @@ -49,23 +49,23 @@ def rotate_image( rot_mat[1, 2] += (width - old_width) / 2 rot_mat[0, 2] += (height - old_height) / 2 return cast( - np_ndarray_int, + NpNdarrayInt, cv2.warpAffine(image, rot_mat, (int(round(height)), int(round(width))), borderValue=background), ) def crop_image( # pylint: disable=too-many-arguments - image: np_ndarray_int, + image: NpNdarrayInt, x: int, y: int, width: int, height: int, background: Union[Tuple[int], Tuple[int, int, int]], -) -> np_ndarray_int: +) -> NpNdarrayInt: """Crop the image.""" matrice = np.array([[1.0, 0.0, -x], [0.0, 1.0, -y]]) return cast( - np_ndarray_int, + NpNdarrayInt, cv2.warpAffine(image, matrice, (int(round(width)), int(round(height))), borderValue=background), ) @@ -87,9 +87,9 @@ def __init__( # pylint: disable=too-many-arguments self.config_file_name = config_file_name self.root_folder = root_folder self.image_name = image_name - self.image: Optional[np_ndarray_int] = None - self.mask: Optional[np_ndarray_int] = None - self.mask_ready: Optional[np_ndarray_int] = None + self.image: Optional[NpNdarrayInt] = None + self.mask: Optional[NpNdarrayInt] = None + self.mask_ready: Optional[NpNdarrayInt] = None self.process_count = self.step.get("process_count", 0) def init_mask(self) -> None: @@ -109,7 +109,7 @@ def get_process_count(self) -> int: finally: self.process_count += 1 - def get_masked(self) -> np_ndarray_int: + def get_masked(self) -> NpNdarrayInt: """Get the mask.""" if self.image is None: raise Exception("The image is None") @@ -193,7 +193,7 @@ def output(cmd: Union[str, List[str]], **kwargs: Any) -> str: return cast(bytes, subprocess.check_output(cmd, stderr=subprocess.PIPE, **kwargs)).decode() # nosec -def image_diff(image1: np_ndarray_int, image2: np_ndarray_int) -> Tuple[float, np_ndarray_int]: +def image_diff(image1: NpNdarrayInt, image2: NpNdarrayInt) -> Tuple[float, NpNdarrayInt]: """Do a diff between images.""" width = max(image1.shape[1], image2.shape[1]) height = max(image1.shape[0], image2.shape[0]) @@ -212,7 +212,7 @@ def image_diff(image1: np_ndarray_int, image2: np_ndarray_int) -> Tuple[float, n class FunctionWithContextReturnsImage(Protocol): """Function with context and returns an image.""" - def __call__(self, context: Context) -> Optional[np_ndarray_int]: + def __call__(self, context: Context) -> Optional[NpNdarrayInt]: """Call the function.""" class FunctionWithContextReturnsNone(Protocol): @@ -323,12 +323,12 @@ def wrapper(context: Context) -> None: def external(func: ExternalFunction) -> FunctionWithContextReturnsImage: """Run an external tool.""" - def wrapper(context: Context) -> Optional[np_ndarray_int]: + def wrapper(context: Context) -> Optional[NpNdarrayInt]: with tempfile.NamedTemporaryFile(suffix=".png") as source: cv2.imwrite(source.name, context.image) with tempfile.NamedTemporaryFile(suffix=".png") as destination: func(context, source.name, destination.name) - return cast(np_ndarray_int, cv2.imread(destination.name)) + return cast(NpNdarrayInt, cv2.imread(destination.name)) return wrapper @@ -392,13 +392,13 @@ def crop(context: Context, margin_horizontal: int, margin_vertical: int) -> None @Process("level") -def level(context: Context) -> np_ndarray_int: +def level(context: Context) -> NpNdarrayInt: """Do the level on an image.""" img_yuv = cv2.cvtColor(context.image, cv2.COLOR_BGR2YUV) if context.config["args"].get("auto_level"): img_yuv[:, :, 0] = cv2.equalizeHist(img_yuv[:, :, 0]) - return cast(np_ndarray_int, cv2.cvtColor(img_yuv, cv2.COLOR_YUV2BGR)) + return cast(NpNdarrayInt, cv2.cvtColor(img_yuv, cv2.COLOR_YUV2BGR)) level_ = context.config["args"].get("level") min_p100 = 0.0 max_p100 = 100.0 @@ -417,14 +417,14 @@ def level(context: Context) -> np_ndarray_int: chanel_y = img_yuv[:, :, 0] mins = np.zeros(chanel_y.shape) - maxs: np_ndarray_int = np.zeros(chanel_y.shape) + 255 + maxs: NpNdarrayInt = np.zeros(chanel_y.shape) + 255 values = (chanel_y - min_) / (max_ - min_) * 255 img_yuv[:, :, 0] = np.minimum(maxs, np.maximum(mins, values)) - return cast(np_ndarray_int, cv2.cvtColor(img_yuv, cv2.COLOR_YUV2BGR)) + return cast(NpNdarrayInt, cv2.cvtColor(img_yuv, cv2.COLOR_YUV2BGR)) -def draw_angle(image: np_ndarray_int, angle: float, color: Tuple[int, int, int]) -> None: +def draw_angle(image: NpNdarrayInt, angle: float, color: Tuple[int, int, int]) -> None: """Draw an angle on the image (as a line passed at the center of the image).""" angle = angle % 90 height, width = image.shape[:2] @@ -460,7 +460,7 @@ def deskew(context: Context) -> None: image_status = context.config["images_status"][context.image_name] image = context.get_masked() grayscale = rgb2gray(image) - image = cast(np_ndarray_int, context.image).copy() + image = cast(NpNdarrayInt, context.image).copy() angle, angles, average_deviation, _ = determine_skew_dev(grayscale) if angle is not None: @@ -500,14 +500,14 @@ def docrop(context: Context) -> None: @Process("sharpen") -def sharpen(context: Context) -> Optional[np_ndarray_int]: +def sharpen(context: Context) -> Optional[NpNdarrayInt]: """Sharpen an image.""" if context.config["args"].get("sharpen", False) is False: return None if context.image is None: raise Exception("The image is required") image = cv2.GaussianBlur(context.image, (0, 0), 3) - return cast(np_ndarray_int, cv2.addWeighted(context.image, 1.5, image, -0.5, 0)) + return cast(NpNdarrayInt, cv2.addWeighted(context.image, 1.5, image, -0.5, 0)) @Process("dither") @@ -534,7 +534,7 @@ def autorotate(context: Context) -> None: def draw_line( # pylint: disable=too-many-arguments - image: np_ndarray_int, vertical: bool, position: float, value: int, name: str, type_: str + image: NpNdarrayInt, vertical: bool, position: float, value: int, name: str, type_: str ) -> scan_to_paperless.process_schema.Limit: """Draw a line on an image.""" img_len = image.shape[0 if vertical else 1] @@ -548,7 +548,7 @@ def draw_line( # pylint: disable=too-many-arguments return {"name": name, "type": type_, "value": int(position), "vertical": vertical, "margin": 0} -def draw_rectangle(image: np_ndarray_int, contour: Tuple[int, int, int, int]) -> None: +def draw_rectangle(image: NpNdarrayInt, contour: Tuple[int, int, int, int]) -> None: """Draw a rectangle on an image.""" color = (0, 255, 0) x, y, width, height = contour @@ -562,7 +562,7 @@ def draw_rectangle(image: np_ndarray_int, contour: Tuple[int, int, int, int]) -> cv2.rectangle(image, (x + width - 1, y), (x + width, y + height), color, -1) -def find_lines(image: np_ndarray_int, vertical: bool) -> Tuple[np_ndarray_int, Dict[str, np_ndarray_int]]: +def find_lines(image: NpNdarrayInt, vertical: bool) -> Tuple[NpNdarrayInt, Dict[str, NpNdarrayInt]]: """Find the lines on an image.""" gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) edges = cv2.Canny(gray, 50, 150, apertureSize=3) @@ -592,17 +592,17 @@ def find_lines(image: np_ndarray_int, vertical: bool) -> Tuple[np_ndarray_int, D return peaks, properties -def zero_ranges(values: np_ndarray_int) -> np_ndarray_int: +def zero_ranges(values: NpNdarrayInt) -> NpNdarrayInt: """Create an array that is 1 where a is 0, and pad each end with an extra 0.""" iszero = np.concatenate(([0], np.equal(values, 0).view(np.int8), [0])) # type: ignore absdiff = np.abs(np.diff(iszero)) # type: ignore # Runs start and end where absdiff is 1. ranges = np.where(absdiff == 1)[0].reshape(-1, 2) - return cast(np_ndarray_int, ranges) + return cast(NpNdarrayInt, ranges) def find_limit_contour( - image: np_ndarray_int, + image: NpNdarrayInt, name: str, vertical: bool, min_box_size: float, @@ -634,7 +634,7 @@ def find_limit_contour( def fill_limits( - image: np_ndarray_int, vertical: bool, context: Context + image: NpNdarrayInt, vertical: bool, context: Context ) -> List[scan_to_paperless.process_schema.Limit]: """Find the limit for assisted split.""" peaks, properties = find_lines(image, vertical) @@ -670,7 +670,7 @@ def fill_limits( def find_contours( - image: np_ndarray_int, + image: NpNdarrayInt, name: str, min_size: Union[float, int], min_black: Union[float, int], @@ -830,7 +830,7 @@ def save(root_folder: str, img: str, folder: str, force: bool = False) -> str: def save_image( - image: np_ndarray_int, root_folder: str, folder: str, name: str, force: bool = False + image: NpNdarrayInt, root_folder: str, folder: str, name: str, force: bool = False ) -> Optional[str]: """Save an image.""" if force or os.environ.get("PROGRESS") == "TRUE": From 44b4bfb605505956bc0e66a9f45a258f33974e71 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Oct 2021 14:17:17 +0000 Subject: [PATCH 13/32] Bump c2cciutils from 1.1.dev20211007121148 to 1.1.dev20211008082520 --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index 0c1ff193..d362ac7f 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,2 +1,2 @@ -c2cciutils==1.1.dev20211007121148 +c2cciutils==1.1.dev20211008082520 jsonschema2md==0.2.1 From 3119ba3cd2ed6059943f7f896b793db35baa1008 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Oct 2021 14:23:40 +0000 Subject: [PATCH 14/32] Bump deskew from 0.10.33 to 0.10.34 --- Pipfile | 2 +- Pipfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index f877e6b9..d7332c97 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ numpy = "==1.21.2" scipy = "==1.7.1" scikit-image = "==0.18.3" opencv-python-headless = "==4.5.3.56" -deskew = "==0.10.33" +deskew = "==0.10.34" jsonschema-gentypes = "==0.9.4" "ruamel.yaml" = "==0.17.4" diff --git a/Pipfile.lock b/Pipfile.lock index 04f817dc..53aeb67f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3b7950f6b8fe154662c690c91d619ed4f9bed26bcc70221343fe9d0156fca356" + "sha256": "6ffd9c3df021972c76286b39209ba09dffaf511d0d4b127c6240543ef2afc651" }, "pipfile-spec": 6, "requires": { @@ -48,11 +48,11 @@ }, "deskew": { "hashes": [ - "sha256:ca7356ebe2431b985a82f2f012fae5449580d517d7bd49045579ab9b0e6f8eee", - "sha256:f90e8a0bf077f13aebd2111ccc14e62b4a48d3ee7c68a70d11b0c847d7167481" + "sha256:2fc982bf0e651e90b36f61e6dbc96c225afeb31e0c97ae807879c7ca17ad0e13", + "sha256:a06f796993a0dd7e29deef6d83835b5863986582c81552be916919b3e427ed9b" ], "index": "pypi", - "version": "==0.10.33" + "version": "==0.10.34" }, "idna": { "hashes": [ @@ -657,7 +657,7 @@ "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899", "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2" ], - "markers": "python_version < '4' and python_full_version >= '3.6.1'", + "markers": "python_version < '4.0' and python_full_version >= '3.6.1'", "version": "==5.9.3" }, "lazy-object-proxy": { From d3936cbcd396641ac4e16e56fece6779fe9a13a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Oct 2021 14:21:09 +0000 Subject: [PATCH 15/32] Bump c2cciutils from 1.1.dev20211008082520 to 1.1.dev20211008145734 --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index d362ac7f..5e1e893b 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,2 +1,2 @@ -c2cciutils==1.1.dev20211008082520 +c2cciutils==1.1.dev20211008145734 jsonschema2md==0.2.1 From 0a9bd32b4fb07ea67c4fe4b9c3fc4c6647537afd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Oct 2021 14:25:35 +0000 Subject: [PATCH 16/32] Bump c2cciutils from 1.1.dev20211008145734 to 1.1.dev20211012114625 --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index 5e1e893b..430f74bd 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,2 +1,2 @@ -c2cciutils==1.1.dev20211008145734 +c2cciutils==1.1.dev20211012114625 jsonschema2md==0.2.1 From 79c20902e1b58a725b73c30d881ff15b82a88964 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Oct 2021 14:26:09 +0000 Subject: [PATCH 17/32] Bump coverage from 6.0.1 to 6.0.2 --- Pipfile | 2 +- Pipfile.lock | 108 +++++++++++++++++++++++++-------------------------- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/Pipfile b/Pipfile index d7332c97..9223794f 100644 --- a/Pipfile +++ b/Pipfile @@ -16,7 +16,7 @@ jsonschema-gentypes = "==0.9.4" prospector = {extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "==1.5.1"} flake8 = "==3.9.2" pytest = "==6.2.5" -coverage = "==6.0.1" +coverage = "==6.0.2" pytest-profiling = "==1.7.0" argcomplete = "==1.12.3" diff --git a/Pipfile.lock b/Pipfile.lock index 53aeb67f..91c8aee6 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "6ffd9c3df021972c76286b39209ba09dffaf511d0d4b127c6240543ef2afc651" + "sha256": "3e1ae753e1e031b12608610254eb4e6def372e3d9fd45a758ebb298668f2ef28" }, "pipfile-spec": 6, "requires": { @@ -26,18 +26,18 @@ }, "certifi": { "hashes": [ - "sha256:2bbf76fd432960138b3ef6dda3dde0544f27cbf8546c458e60baf371917ba9ee", - "sha256:50b1e4f8446b06f41be7dd6338db18e0990601dce795c2b1686458aa7e8fa7d8" + "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872", + "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569" ], - "version": "==2021.5.30" + "version": "==2021.10.8" }, "charset-normalizer": { "hashes": [ - "sha256:5d209c0a931f215cee683b6445e2d77677e7e75e159f78def0db09d68fafcaa6", - "sha256:5ec46d183433dcbd0ab716f2d7f29d8dee50505b3fdb40c6b985c7c4f5a3591f" + "sha256:e019de665e2bcf9c2b64e2e5aa025fa991da8720daa3c1138cadd2fd1856aed0", + "sha256:f7af805c321bfa1ce6714c51f254e0d5bb5e5834039bc17db7ebe3a4cec9492b" ], "markers": "python_version >= '3'", - "version": "==2.0.6" + "version": "==2.0.7" }, "cycler": { "hashes": [ @@ -71,11 +71,11 @@ }, "jsonschema": { "hashes": [ - "sha256:48f4e74f8bec0c2f75e9fcfffa264e78342873e1b57e2cfeae54864cc5e9e4dd", - "sha256:9938802041347f2c62cad2aef59e9a0826cd34584f3609db950efacb4dbf6518" + "sha256:2b3cca28580511d44326f0e7fc582eab3cbe31aabd1a1c2cfa74a399796ffd84", + "sha256:9dd7c33b4a96138dc37bb86b3610d3b12d30d96433d4d73435ca3025804154a8" ], "markers": "python_version >= '3.7'", - "version": "==4.0.1" + "version": "==4.1.0" }, "jsonschema-gentypes": { "hashes": [ @@ -476,11 +476,11 @@ }, "tifffile": { "hashes": [ - "sha256:524f9f3a96ca91d12e5b5ddce80209d2b07769c1764ceecf505613668143f63c", - "sha256:8760e61e30106ea0dab9ec42a238d70a3ff55dde9c54456e7b748fe717cb782d" + "sha256:86c11d33d8101fcb9bec04d2c342982742d11e2a5a8cc770fbbcd4733bdba76a", + "sha256:ec0eb6c54a1c097b8bb92467b36819642f34646b4cb37a73a3f85d92d4181684" ], "markers": "python_version >= '3.7'", - "version": "==2021.8.30" + "version": "==2021.10.10" }, "unidecode": { "hashes": [ @@ -533,57 +533,57 @@ }, "certifi": { "hashes": [ - "sha256:2bbf76fd432960138b3ef6dda3dde0544f27cbf8546c458e60baf371917ba9ee", - "sha256:50b1e4f8446b06f41be7dd6338db18e0990601dce795c2b1686458aa7e8fa7d8" + "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872", + "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569" ], - "version": "==2021.5.30" + "version": "==2021.10.8" }, "charset-normalizer": { "hashes": [ - "sha256:5d209c0a931f215cee683b6445e2d77677e7e75e159f78def0db09d68fafcaa6", - "sha256:5ec46d183433dcbd0ab716f2d7f29d8dee50505b3fdb40c6b985c7c4f5a3591f" + "sha256:e019de665e2bcf9c2b64e2e5aa025fa991da8720daa3c1138cadd2fd1856aed0", + "sha256:f7af805c321bfa1ce6714c51f254e0d5bb5e5834039bc17db7ebe3a4cec9492b" ], "markers": "python_version >= '3'", - "version": "==2.0.6" + "version": "==2.0.7" }, "coverage": { "hashes": [ - "sha256:07efe1fbd72e67df026ad5109bcd216acbbd4a29d5208b3dab61779bae6b7b26", - "sha256:0898d6948b31df13391cd40568de8f35fa5901bc922c5ae05cf070587cb9c666", - "sha256:0a7e55cc9f7efa22d5cc9966276ec7a40a8803676f6ccbfdc06a486fba9aa9ee", - "sha256:17426808e8e0824f864876312d41961223bf5e503bf8f1f846735279a60ea345", - "sha256:1770d24f45f1f2daeae34cfa3b33fcb29702153544cd2ad40d58399dd4ff53b5", - "sha256:1864bdf9b2ccb43e724051bc23a1c558daf101ad4488ede1945f2a8be1facdad", - "sha256:2c5f39d1556e75fc3c4fb071f9e7cfa618895a999a0de763a541d730775d0d5f", - "sha256:3490ff6dbf3f7accf0750136ed60ae1f487bccc1f097740e3b21262bc9c89854", - "sha256:353a50f123f0185cdb7a1e1e3e2cfb9d1fd7e293cfaf68eedaf5bd8e02e3ec32", - "sha256:3edbb3ec580c73e5a264f5d04f30245bc98eff1a26765d46c5c65134f0a0e2f7", - "sha256:4eb9cd910ca8e243f930243a9940ea1a522e32435d15668445753d087c30ee12", - "sha256:5b06f4f1729e2963281d9cd6e65e6976bf27b44d4c07ac5b47223ce45f822cec", - "sha256:5b1ceacb86e0a9558061dcc6baae865ed25933ea57effea644f21657cdce19bc", - "sha256:65da6e3e8325291f012921bbf71fea0a97824e1c573981871096aac6e2cf0ec5", - "sha256:66fe33e9e0df58675e08e83fe257f89e7f625e7633ea93d0872154e09cce2724", - "sha256:6873f3f954d3e3ab8b1881f4e5307cc19f70c9f931c41048d9f7e6fd946eabe7", - "sha256:73880a80fad0597eca43e213e5e1711bf6c0fcdb7eb6b01b3b17841ebe5a7f8d", - "sha256:7600fac458f74c68b097379f76f3a6e3a630493fc7fc94b6508fedd9d498c194", - "sha256:83682b73785d2e078e0b5f63410b8125b122e1a22422640c57edd4011c950f3e", - "sha256:83faa3692e8306b20293889714fdf573d10ef5efc5843bd7c7aea6971487bd6a", - "sha256:9c416ba03844608f45661a5b48dc59c6b5e89956efe388564dd138ca8caf540b", - "sha256:9d242a2434801ef5125330deddb4cddba8990c9a49b3dec99dca17dd7eefba5a", - "sha256:a2e15ab5afbee34abf716fece80ea33ea09a82e7450512f022723b1a82ec9a4e", - "sha256:abe8207dfb8a61ded9cd830d26c1073c8218fc0ae17eb899cfe8ec0fafae6e22", - "sha256:ad7182a82843f9f85487f44567c8c688f16c906bdb8d0e44ae462aed61cb8f1b", - "sha256:b45f89a8ef65c29195f8f28dbe215f44ccb29d934f3e862d2a5c12e38698a793", - "sha256:b81a4e667c45b13658b84f9b8f1d32ef86d5405fabcbd181b76b9e51d295f397", - "sha256:c9c413c4397d4cdc7ca89286158d240ce524f9667b52c9a64dd7e13d16cf8815", - "sha256:e11cca9eb5c9b3eaad899728ee2ce916138399ee8cbbccaadc1871fecb750827", - "sha256:e66c50f0ab445fec920a9f084914ea1776a809e3016c3738519048195f851bbb", - "sha256:ea452a2d83964d08232ade470091015e7ab9b8f53acbec10f2210fbab4ce7e43", - "sha256:f398d38e6ebc2637863db1d7be3d4f9c5174e7d24bb3b0716cdb1f204669cbcf", - "sha256:f82a17f2a77958f3eef40ad385fc82d4c6ba9a77a51a174efe03ce75daebbc16" + "sha256:04560539c19ec26995ecfb3d9307ff154fbb9a172cb57e3b3cfc4ced673103d1", + "sha256:1549e1d08ce38259de2bc3e9a0d5f3642ff4a8f500ffc1b2df73fd621a6cdfc0", + "sha256:1db67c497688fd4ba85b373b37cc52c50d437fd7267520ecd77bddbd89ea22c9", + "sha256:30922626ce6f7a5a30bdba984ad21021529d3d05a68b4f71ea3b16bda35b8895", + "sha256:36e9040a43d2017f2787b28d365a4bb33fcd792c7ff46a047a04094dc0e2a30d", + "sha256:381d773d896cc7f8ba4ff3b92dee4ed740fb88dfe33b6e42efc5e8ab6dfa1cfe", + "sha256:3bbda1b550e70fa6ac40533d3f23acd4f4e9cb4e6e77251ce77fdf41b3309fb2", + "sha256:3be1206dc09fb6298de3fce70593e27436862331a85daee36270b6d0e1c251c4", + "sha256:424c44f65e8be58b54e2b0bd1515e434b940679624b1b72726147cfc6a9fc7ce", + "sha256:4b34ae4f51bbfa5f96b758b55a163d502be3dcb24f505d0227858c2b3f94f5b9", + "sha256:4e28d2a195c533b58fc94a12826f4431726d8eb029ac21d874345f943530c122", + "sha256:53a294dc53cfb39c74758edaa6305193fb4258a30b1f6af24b360a6c8bd0ffa7", + "sha256:60e51a3dd55540bec686d7fff61b05048ca31e804c1f32cbb44533e6372d9cc3", + "sha256:61b598cbdbaae22d9e34e3f675997194342f866bb1d781da5d0be54783dce1ff", + "sha256:6807947a09510dc31fa86f43595bf3a14017cd60bf633cc746d52141bfa6b149", + "sha256:6a6a9409223a27d5ef3cca57dd7cd4dfcb64aadf2fad5c3b787830ac9223e01a", + "sha256:7092eab374346121805fb637572483270324407bf150c30a3b161fc0c4ca5164", + "sha256:77b1da5767ed2f44611bc9bc019bc93c03fa495728ec389759b6e9e5039ac6b1", + "sha256:8251b37be1f2cd9c0e5ccd9ae0380909c24d2a5ed2162a41fcdbafaf59a85ebd", + "sha256:9f1627e162e3864a596486774876415a7410021f4b67fd2d9efdf93ade681afc", + "sha256:a1b73c7c4d2a42b9d37dd43199c5711d91424ff3c6c22681bc132db4a4afec6f", + "sha256:a82d79586a0a4f5fd1cf153e647464ced402938fbccb3ffc358c7babd4da1dd9", + "sha256:abbff240f77347d17306d3201e14431519bf64495648ca5a49571f988f88dee9", + "sha256:ad9b8c1206ae41d46ec7380b78ba735ebb77758a650643e841dd3894966c31d0", + "sha256:bbffde2a68398682623d9dd8c0ca3f46fda074709b26fcf08ae7a4c431a6ab2d", + "sha256:bcae10fccb27ca2a5f456bf64d84110a5a74144be3136a5e598f9d9fb48c0caa", + "sha256:c9cd3828bbe1a40070c11fe16a51df733fd2f0cb0d745fb83b7b5c1f05967df7", + "sha256:cd1cf1deb3d5544bd942356364a2fdc8959bad2b6cf6eb17f47d301ea34ae822", + "sha256:d036dc1ed8e1388e995833c62325df3f996675779541f682677efc6af71e96cc", + "sha256:db42baa892cba723326284490283a68d4de516bfb5aaba369b4e3b2787a778b7", + "sha256:e4fb7ced4d9dec77d6cf533acfbf8e1415fe799430366affb18d69ee8a3c6330", + "sha256:e7a0b42db2a47ecb488cde14e0f6c7679a2c5a9f44814393b162ff6397fcdfbb", + "sha256:f2f184bf38e74f152eed7f87e345b51f3ab0b703842f447c22efe35e59942c24" ], "index": "pypi", - "version": "==6.0.1" + "version": "==6.0.2" }, "docutils": { "hashes": [ @@ -657,7 +657,7 @@ "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899", "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2" ], - "markers": "python_version < '4.0' and python_full_version >= '3.6.1'", + "markers": "python_version < '4' and python_full_version >= '3.6.1'", "version": "==5.9.3" }, "lazy-object-proxy": { From bcaea0ccfd9553422658a0d37798285699dba355 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Oct 2021 14:42:03 +0000 Subject: [PATCH 18/32] Bump deskew from 0.10.34 to 0.10.36 --- Pipfile | 2 +- Pipfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index 9223794f..608f87b1 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ numpy = "==1.21.2" scipy = "==1.7.1" scikit-image = "==0.18.3" opencv-python-headless = "==4.5.3.56" -deskew = "==0.10.34" +deskew = "==0.10.36" jsonschema-gentypes = "==0.9.4" "ruamel.yaml" = "==0.17.4" diff --git a/Pipfile.lock b/Pipfile.lock index 91c8aee6..7de2e77d 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3e1ae753e1e031b12608610254eb4e6def372e3d9fd45a758ebb298668f2ef28" + "sha256": "1aee434bf2b223a821dac121840157d29258726676707307af351cb5584d3a64" }, "pipfile-spec": 6, "requires": { @@ -48,11 +48,11 @@ }, "deskew": { "hashes": [ - "sha256:2fc982bf0e651e90b36f61e6dbc96c225afeb31e0c97ae807879c7ca17ad0e13", - "sha256:a06f796993a0dd7e29deef6d83835b5863986582c81552be916919b3e427ed9b" + "sha256:34da4600b426e317da25d439fceef723e1bd905b90ab295aff5a1b4e2feeb563", + "sha256:506f8e6a1e44f989ba4b9cc39ce21aa97f58d9b204c2f9709aad274fbba2bae0" ], "index": "pypi", - "version": "==0.10.34" + "version": "==0.10.36" }, "idna": { "hashes": [ @@ -657,7 +657,7 @@ "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899", "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2" ], - "markers": "python_version < '4' and python_full_version >= '3.6.1'", + "markers": "python_version < '4.0' and python_full_version >= '3.6.1'", "version": "==5.9.3" }, "lazy-object-proxy": { From b2d789ff539f351d8ab188846913ddd5e76f5866 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Oct 2021 14:26:28 +0000 Subject: [PATCH 19/32] Bump c2cciutils from 1.1.dev20211012114625 to 1.1.dev20211019114043 --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index 430f74bd..279af8e3 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,2 +1,2 @@ -c2cciutils==1.1.dev20211012114625 +c2cciutils==1.1.dev20211019114043 jsonschema2md==0.2.1 From 9ce957916dabb7b5ede018389f08992dfb3b8c3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:21:14 +0000 Subject: [PATCH 20/32] Bump c2cciutils from 1.1.dev20211019114043 to 1.1.dev20211021112135 --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index 279af8e3..2ba527d9 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,2 +1,2 @@ -c2cciutils==1.1.dev20211019114043 +c2cciutils==1.1.dev20211021112135 jsonschema2md==0.2.1 From d2adce481cdef7435e6813ef0efb239abcc3c089 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:26:52 +0000 Subject: [PATCH 21/32] Bump numpy from 1.21.2 to 1.21.3 --- Pipfile | 2 +- Pipfile.lock | 315 +++++++++++++++++++++++++++++---------------------- 2 files changed, 178 insertions(+), 139 deletions(-) diff --git a/Pipfile b/Pipfile index 608f87b1..eb1095c8 100644 --- a/Pipfile +++ b/Pipfile @@ -4,7 +4,7 @@ verify_ssl = true name = "pypi" [packages] -numpy = "==1.21.2" +numpy = "==1.21.3" scipy = "==1.7.1" scikit-image = "==0.18.3" opencv-python-headless = "==4.5.3.56" diff --git a/Pipfile.lock b/Pipfile.lock index 7de2e77d..c36e9288 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "1aee434bf2b223a821dac121840157d29258726676707307af351cb5584d3a64" + "sha256": "596a898a6cbae93c91b4a1d1b110e6d84b08a5c2f6df3b2e58f17df5aca57fa9" }, "pipfile-spec": 6, "requires": { @@ -56,11 +56,11 @@ }, "idna": { "hashes": [ - "sha256:14475042e284991034cb48e06f6851428fb14c4dc953acd9be9a5e95c7b6dd7a", - "sha256:467fbad99067910785144ce333826c71fb0e63a425657295239737f7ecd125f3" + "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff", + "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" ], "markers": "python_version >= '3'", - "version": "==3.2" + "version": "==3.3" }, "imageio": { "hashes": [ @@ -71,11 +71,11 @@ }, "jsonschema": { "hashes": [ - "sha256:2b3cca28580511d44326f0e7fc582eab3cbe31aabd1a1c2cfa74a399796ffd84", - "sha256:9dd7c33b4a96138dc37bb86b3610d3b12d30d96433d4d73435ca3025804154a8" + "sha256:166870c8ab27bd712a8627e0598de4685bd8d199c4d7bd7cacc3d941ba0c6ca0", + "sha256:5c1a282ee6b74235057421fd0f766ac5f2972f77440927f6471c9e8493632fac" ], "markers": "python_version >= '3.7'", - "version": "==4.1.0" + "version": "==4.1.2" }, "jsonschema-gentypes": { "hashes": [ @@ -171,39 +171,42 @@ }, "numpy": { "hashes": [ - "sha256:09858463db6dd9f78b2a1a05c93f3b33d4f65975771e90d2cf7aadb7c2f66edf", - "sha256:209666ce9d4a817e8a4597cd475b71b4878a85fa4b8db41d79fdb4fdee01dde2", - "sha256:298156f4d3d46815eaf0fcf0a03f9625fc7631692bd1ad851517ab93c3168fc6", - "sha256:30fc68307c0155d2a75ad19844224be0f2c6f06572d958db4e2053f816b859ad", - "sha256:423216d8afc5923b15df86037c6053bf030d15cc9e3224206ef868c2d63dd6dc", - "sha256:426a00b68b0d21f2deb2ace3c6d677e611ad5a612d2c76494e24a562a930c254", - "sha256:466e682264b14982012887e90346d33435c984b7fead7b85e634903795c8fdb0", - "sha256:51a7b9db0a2941434cd930dacaafe0fc9da8f3d6157f9d12f761bbde93f46218", - "sha256:52a664323273c08f3b473548bf87c8145b7513afd63e4ebba8496ecd3853df13", - "sha256:550564024dc5ceee9421a86fc0fb378aa9d222d4d0f858f6669eff7410c89bef", - "sha256:5de64950137f3a50b76ce93556db392e8f1f954c2d8207f78a92d1f79aa9f737", - "sha256:640c1ccfd56724f2955c237b6ccce2e5b8607c3bc1cc51d3933b8c48d1da3723", - "sha256:7fdc7689daf3b845934d67cb221ba8d250fdca20ac0334fea32f7091b93f00d3", - "sha256:805459ad8baaf815883d0d6f86e45b3b0b67d823a8f3fa39b1ed9c45eaf5edf1", - "sha256:92a0ab128b07799dd5b9077a9af075a63467d03ebac6f8a93e6440abfea4120d", - "sha256:9f2dc79c093f6c5113718d3d90c283f11463d77daa4e83aeeac088ec6a0bda52", - "sha256:a5109345f5ce7ddb3840f5970de71c34a0ff7fceb133c9441283bb8250f532a3", - "sha256:a55e4d81c4260386f71d22294795c87609164e22b28ba0d435850fbdf82fc0c5", - "sha256:a9da45b748caad72ea4a4ed57e9cd382089f33c5ec330a804eb420a496fa760f", - "sha256:b160b9a99ecc6559d9e6d461b95c8eec21461b332f80267ad2c10394b9503496", - "sha256:b342064e647d099ca765f19672696ad50c953cac95b566af1492fd142283580f", - "sha256:b5e8590b9245803c849e09bae070a8e1ff444f45e3f0bed558dd722119eea724", - "sha256:bf75d5825ef47aa51d669b03ce635ecb84d69311e05eccea083f31c7570c9931", - "sha256:c01b59b33c7c3ba90744f2c695be571a3bd40ab2ba7f3d169ffa6db3cfba614f", - "sha256:d96a6a7d74af56feb11e9a443150216578ea07b7450f7c05df40eec90af7f4a7", - "sha256:dd0e3651d210068d13e18503d75aaa45656eef51ef0b261f891788589db2cc38", - "sha256:e167b9805de54367dcb2043519382be541117503ce99e3291cc9b41ca0a83557", - "sha256:e42029e184008a5fd3d819323345e25e2337b0ac7f5c135b7623308530209d57", - "sha256:f545c082eeb09ae678dd451a1b1dbf17babd8a0d7adea02897a76e639afca310", - "sha256:fde50062d67d805bc96f1a9ecc0d37bfc2a8f02b937d2c50824d186aa91f2419" + "sha256:043e83bfc274649c82a6f09836943e4a4aebe5e33656271c7dbf9621dd58b8ec", + "sha256:160ccc1bed3a8371bf0d760971f09bfe80a3e18646620e9ded0ad159d9749baa", + "sha256:188031f833bbb623637e66006cf75e933e00e7231f67e2b45cf8189612bb5dc3", + "sha256:28f15209fb535dd4c504a7762d3bc440779b0e37d50ed810ced209e5cea60d96", + "sha256:29fb3dcd0468b7715f8ce2c0c2d9bbbaf5ae686334951343a41bd8d155c6ea27", + "sha256:2a6ee9620061b2a722749b391c0d80a0e2ae97290f1b32e28d5a362e21941ee4", + "sha256:300321e3985c968e3ae7fbda187237b225f3ffe6528395a5b7a5407f73cf093e", + "sha256:32437f0b275c1d09d9c3add782516413e98cd7c09e6baf4715cbce781fc29912", + "sha256:3c09418a14471c7ae69ba682e2428cae5b4420a766659605566c0fa6987f6b7e", + "sha256:49c6249260890e05b8111ebfc391ed58b3cb4b33e63197b2ec7f776e45330721", + "sha256:4cc9b512e9fb590797474f58b7f6d1f1b654b3a94f4fa8558b48ca8b3cfc97cf", + "sha256:508b0b513fa1266875524ba8a9ecc27b02ad771fe1704a16314dc1a816a68737", + "sha256:50cd26b0cf6664cb3b3dd161ba0a09c9c1343db064e7c69f9f8b551f5104d654", + "sha256:5c4193f70f8069550a1788bd0cd3268ab7d3a2b70583dfe3b2e7f421e9aace06", + "sha256:5dfe9d6a4c39b8b6edd7990091fea4f852888e41919d0e6722fe78dd421db0eb", + "sha256:63571bb7897a584ca3249c86dd01c10bcb5fe4296e3568b2e9c1a55356b6410e", + "sha256:75621882d2230ab77fb6a03d4cbccd2038511491076e7964ef87306623aa5272", + "sha256:75eb7cadc8da49302f5b659d40ba4f6d94d5045fbd9569c9d058e77b0514c9e4", + "sha256:88a5d6b268e9ad18f3533e184744acdaa2e913b13148160b1152300c949bbb5f", + "sha256:8a10968963640e75cc0193e1847616ab4c718e83b6938ae74dea44953950f6b7", + "sha256:90bec6a86b348b4559b6482e2b684db4a9a7eed1fa054b86115a48d58fbbf62a", + "sha256:98339aa9911853f131de11010f6dd94c8cec254d3d1f7261528c3b3e3219f139", + "sha256:a99a6b067e5190ac6d12005a4d85aa6227c5606fa93211f86b1dafb16233e57d", + "sha256:bffa2eee3b87376cc6b31eee36d05349571c236d1de1175b804b348dc0941e3f", + "sha256:c6c2d535a7beb1f8790aaa98fd089ceab2e3dd7ca48aca0af7dc60e6ef93ffe1", + "sha256:cc14e7519fab2a4ed87d31f99c31a3796e4e1fe63a86ebdd1c5a1ea78ebd5896", + "sha256:dd0482f3fc547f1b1b5d6a8b8e08f63fdc250c58ce688dedd8851e6e26cff0f3", + "sha256:dde972a1e11bb7b702ed0e447953e7617723760f420decb97305e66fb4afc54f", + "sha256:e54af82d68ef8255535a6cdb353f55d6b8cf418a83e2be3569243787a4f4866f", + "sha256:e606e6316911471c8d9b4618e082635cfe98876007556e89ce03d52ff5e8fcf0", + "sha256:f41b018f126aac18583956c54544db437f25c7ee4794bcb23eb38bef8e5e192a", + "sha256:f8f4625536926a155b80ad2bbff44f8cc59e9f2ad14cdda7acf4c135b4dc8ff2", + "sha256:fe52dbe47d9deb69b05084abd4b0df7abb39a3c51957c09f635520abd49b29dd" ], "index": "pypi", - "version": "==1.21.2" + "version": "==1.21.3" }, "opencv-python-headless": { "hashes": [ @@ -237,62 +240,50 @@ }, "pillow": { "hashes": [ - "sha256:0412516dcc9de9b0a1e0ae25a280015809de8270f134cc2c1e32c4eeb397cf30", - "sha256:04835e68ef12904bc3e1fd002b33eea0779320d4346082bd5b24bec12ad9c3e9", - "sha256:06d1adaa284696785375fa80a6a8eb309be722cf4ef8949518beb34487a3df71", - "sha256:085a90a99404b859a4b6c3daa42afde17cb3ad3115e44a75f0d7b4a32f06a6c9", - "sha256:0b9911ec70731711c3b6ebcde26caea620cbdd9dcb73c67b0730c8817f24711b", - "sha256:10e00f7336780ca7d3653cf3ac26f068fa11b5a96894ea29a64d3dc4b810d630", - "sha256:11c27e74bab423eb3c9232d97553111cc0be81b74b47165f07ebfdd29d825875", - "sha256:11eb7f98165d56042545c9e6db3ce394ed8b45089a67124298f0473b29cb60b2", - "sha256:13654b521fb98abdecec105ea3fb5ba863d1548c9b58831dd5105bb3873569f1", - "sha256:15ccb81a6ffc57ea0137f9f3ac2737ffa1d11f786244d719639df17476d399a7", - "sha256:18a07a683805d32826c09acfce44a90bf474e6a66ce482b1c7fcd3757d588df3", - "sha256:19ec4cfe4b961edc249b0e04b5618666c23a83bc35842dea2bfd5dfa0157f81b", - "sha256:1c3ff00110835bdda2b1e2b07f4a2548a39744bb7de5946dc8e95517c4fb2ca6", - "sha256:27a330bf7014ee034046db43ccbb05c766aa9e70b8d6c5260bfc38d73103b0ba", - "sha256:2b11c9d310a3522b0fd3c35667914271f570576a0e387701f370eb39d45f08a4", - "sha256:2c661542c6f71dfd9dc82d9d29a8386287e82813b0375b3a02983feac69ef864", - "sha256:2cde7a4d3687f21cffdf5bb171172070bb95e02af448c4c8b2f223d783214056", - "sha256:2d5e9dc0bf1b5d9048a94c48d0813b6c96fccfa4ccf276d9c36308840f40c228", - "sha256:2f23b2d3079522fdf3c09de6517f625f7a964f916c956527bed805ac043799b8", - "sha256:35d27687f027ad25a8d0ef45dd5208ef044c588003cdcedf05afb00dbc5c2deb", - "sha256:35d409030bf3bd05fa66fb5fdedc39c521b397f61ad04309c90444e893d05f7d", - "sha256:4326ea1e2722f3dc00ed77c36d3b5354b8fb7399fb59230249ea6d59cbed90da", - "sha256:4abc247b31a98f29e5224f2d31ef15f86a71f79c7f4d2ac345a5d551d6393073", - "sha256:4d89a2e9219a526401015153c0e9dd48319ea6ab9fe3b066a20aa9aee23d9fd3", - "sha256:4e59e99fd680e2b8b11bbd463f3c9450ab799305d5f2bafb74fefba6ac058616", - "sha256:548794f99ff52a73a156771a0402f5e1c35285bd981046a502d7e4793e8facaa", - "sha256:56fd98c8294f57636084f4b076b75f86c57b2a63a8410c0cd172bc93695ee979", - "sha256:59697568a0455764a094585b2551fd76bfd6b959c9f92d4bdec9d0e14616303a", - "sha256:6bff50ba9891be0a004ef48828e012babaaf7da204d81ab9be37480b9020a82b", - "sha256:6cb3dd7f23b044b0737317f892d399f9e2f0b3a02b22b2c692851fb8120d82c6", - "sha256:7dbfbc0020aa1d9bc1b0b8bcf255a7d73f4ad0336f8fd2533fcc54a4ccfb9441", - "sha256:838eb85de6d9307c19c655c726f8d13b8b646f144ca6b3771fa62b711ebf7624", - "sha256:8b68f565a4175e12e68ca900af8910e8fe48aaa48fd3ca853494f384e11c8bcd", - "sha256:8f284dc1695caf71a74f24993b7c7473d77bc760be45f776a2c2f4e04c170550", - "sha256:963ebdc5365d748185fdb06daf2ac758116deecb2277ec5ae98139f93844bc09", - "sha256:a048dad5ed6ad1fad338c02c609b862dfaa921fcd065d747194a6805f91f2196", - "sha256:a1bd983c565f92779be456ece2479840ec39d386007cd4ae83382646293d681b", - "sha256:a66566f8a22561fc1a88dc87606c69b84fa9ce724f99522cf922c801ec68f5c1", - "sha256:bcb04ff12e79b28be6c9988f275e7ab69f01cc2ba319fb3114f87817bb7c74b6", - "sha256:bd24054aaf21e70a51e2a2a5ed1183560d3a69e6f9594a4bfe360a46f94eba83", - "sha256:be25cb93442c6d2f8702c599b51184bd3ccd83adebd08886b682173e09ef0c3f", - "sha256:c691b26283c3a31594683217d746f1dad59a7ae1d4cfc24626d7a064a11197d4", - "sha256:cc9d0dec711c914ed500f1d0d3822868760954dce98dfb0b7382a854aee55d19", - "sha256:ce2e5e04bb86da6187f96d7bab3f93a7877830981b37f0287dd6479e27a10341", - "sha256:ce651ca46d0202c302a535d3047c55a0131a720cf554a578fc1b8a2aff0e7d96", - "sha256:d0c8ebbfd439c37624db98f3877d9ed12c137cadd99dde2d2eae0dab0bbfc355", - "sha256:d675a876b295afa114ca8bf42d7f86b5fb1298e1b6bb9a24405a3f6c8338811c", - "sha256:dde3f3ed8d00c72631bc19cbfff8ad3b6215062a5eed402381ad365f82f0c18c", - "sha256:e5a31c07cea5edbaeb4bdba6f2b87db7d3dc0f446f379d907e51cc70ea375629", - "sha256:f514c2717012859ccb349c97862568fdc0479aad85b0270d6b5a6509dbc142e2", - "sha256:fc0db32f7223b094964e71729c0361f93db43664dd1ec86d3df217853cedda87", - "sha256:fd4fd83aa912d7b89b4b4a1580d30e2a4242f3936882a3f433586e5ab97ed0d5", - "sha256:feb5db446e96bfecfec078b943cc07744cc759893cef045aa8b8b6d6aaa8274e" + "sha256:066f3999cb3b070a95c3652712cffa1a748cd02d60ad7b4e485c3748a04d9d76", + "sha256:0a0956fdc5defc34462bb1c765ee88d933239f9a94bc37d132004775241a7585", + "sha256:0b052a619a8bfcf26bd8b3f48f45283f9e977890263e4571f2393ed8898d331b", + "sha256:1394a6ad5abc838c5cd8a92c5a07535648cdf6d09e8e2d6df916dfa9ea86ead8", + "sha256:1bc723b434fbc4ab50bb68e11e93ce5fb69866ad621e3c2c9bdb0cd70e345f55", + "sha256:244cf3b97802c34c41905d22810846802a3329ddcb93ccc432870243211c79fc", + "sha256:25a49dc2e2f74e65efaa32b153527fc5ac98508d502fa46e74fa4fd678ed6645", + "sha256:2e4440b8f00f504ee4b53fe30f4e381aae30b0568193be305256b1462216feff", + "sha256:3862b7256046fcd950618ed22d1d60b842e3a40a48236a5498746f21189afbbc", + "sha256:3eb1ce5f65908556c2d8685a8f0a6e989d887ec4057326f6c22b24e8a172c66b", + "sha256:3f97cfb1e5a392d75dd8b9fd274d205404729923840ca94ca45a0af57e13dbe6", + "sha256:493cb4e415f44cd601fcec11c99836f707bb714ab03f5ed46ac25713baf0ff20", + "sha256:4acc0985ddf39d1bc969a9220b51d94ed51695d455c228d8ac29fcdb25810e6e", + "sha256:5503c86916d27c2e101b7f71c2ae2cddba01a2cf55b8395b0255fd33fa4d1f1a", + "sha256:5b7bb9de00197fb4261825c15551adf7605cf14a80badf1761d61e59da347779", + "sha256:5e9ac5f66616b87d4da618a20ab0a38324dbe88d8a39b55be8964eb520021e02", + "sha256:620582db2a85b2df5f8a82ddeb52116560d7e5e6b055095f04ad828d1b0baa39", + "sha256:62cc1afda735a8d109007164714e73771b499768b9bb5afcbbee9d0ff374b43f", + "sha256:70ad9e5c6cb9b8487280a02c0ad8a51581dcbbe8484ce058477692a27c151c0a", + "sha256:72b9e656e340447f827885b8d7a15fc8c4e68d410dc2297ef6787eec0f0ea409", + "sha256:72cbcfd54df6caf85cc35264c77ede902452d6df41166010262374155947460c", + "sha256:792e5c12376594bfcb986ebf3855aa4b7c225754e9a9521298e460e92fb4a488", + "sha256:7b7017b61bbcdd7f6363aeceb881e23c46583739cb69a3ab39cb384f6ec82e5b", + "sha256:81f8d5c81e483a9442d72d182e1fb6dcb9723f289a57e8030811bac9ea3fef8d", + "sha256:82aafa8d5eb68c8463b6e9baeb4f19043bb31fefc03eb7b216b51e6a9981ae09", + "sha256:84c471a734240653a0ec91dec0996696eea227eafe72a33bd06c92697728046b", + "sha256:8c803ac3c28bbc53763e6825746f05cc407b20e4a69d0122e526a582e3b5e153", + "sha256:93ce9e955cc95959df98505e4608ad98281fff037350d8c2671c9aa86bcf10a9", + "sha256:9a3e5ddc44c14042f0844b8cf7d2cd455f6cc80fd7f5eefbe657292cf601d9ad", + "sha256:a4901622493f88b1a29bd30ec1a2f683782e57c3c16a2dbc7f2595ba01f639df", + "sha256:a5a4532a12314149d8b4e4ad8ff09dde7427731fcfa5917ff16d0291f13609df", + "sha256:b8831cb7332eda5dc89b21a7bce7ef6ad305548820595033a4b03cf3091235ed", + "sha256:b8e2f83c56e141920c39464b852de3719dfbfb6e3c99a2d8da0edf4fb33176ed", + "sha256:c70e94281588ef053ae8998039610dbd71bc509e4acbc77ab59d7d2937b10698", + "sha256:c8a17b5d948f4ceeceb66384727dde11b240736fddeda54ca740b9b8b1556b29", + "sha256:d82cdb63100ef5eedb8391732375e6d05993b765f72cb34311fab92103314649", + "sha256:d89363f02658e253dbd171f7c3716a5d340a24ee82d38aab9183f7fdf0cdca49", + "sha256:d99ec152570e4196772e7a8e4ba5320d2d27bf22fdf11743dd882936ed64305b", + "sha256:ddc4d832a0f0b4c52fff973a0d44b6c99839a9d016fe4e6a1cb8f3eea96479c2", + "sha256:e3dacecfbeec9a33e932f00c6cd7996e62f53ad46fbe677577394aaa90ee419a", + "sha256:eb9fc393f3c61f9054e1ed26e6fe912c7321af2f41ff49d3f83d05bacf22cc78" ], "markers": "python_version >= '3.6'", - "version": "==8.3.2" + "version": "==8.4.0" }, "pyparsing": { "hashes": [ @@ -476,11 +467,11 @@ }, "tifffile": { "hashes": [ - "sha256:86c11d33d8101fcb9bec04d2c342982742d11e2a5a8cc770fbbcd4733bdba76a", - "sha256:ec0eb6c54a1c097b8bb92467b36819642f34646b4cb37a73a3f85d92d4181684" + "sha256:0a78268a2d844af94929512d28b39bd1ea6fe46de4124103840b5fe4e1c555cd", + "sha256:98de4a48fbce8f2d4ab225df73d8c9dd6df5540291498adf5f1068d268836da9" ], "markers": "python_version >= '3.7'", - "version": "==2021.10.10" + "version": "==2021.10.12" }, "unidecode": { "hashes": [ @@ -510,11 +501,11 @@ }, "astroid": { "hashes": [ - "sha256:304e99c129794f2cfda584a12b71fde85205da950e2f330f4be09150525ae949", - "sha256:9eaeaf92b3e21b70bec1a262e7eb118d2e96294892a5de595c92a12adc80dfc2" + "sha256:0e361da0744d5011d4f5d57e64473ba9b7ab4da1e2d45d6631ebd67dd28c3cce", + "sha256:f9d66e3a4a0e5b52819b2ff41ac2b179df9d180697db71c92beb33a60c661794" ], "markers": "python_version ~= '3.6'", - "version": "==2.8.2" + "version": "==2.8.3" }, "attrs": { "hashes": [ @@ -639,11 +630,11 @@ }, "idna": { "hashes": [ - "sha256:14475042e284991034cb48e06f6851428fb14c4dc953acd9be9a5e95c7b6dd7a", - "sha256:467fbad99067910785144ce333826c71fb0e63a425657295239737f7ecd125f3" + "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff", + "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" ], "markers": "python_version >= '3'", - "version": "==3.2" + "version": "==3.3" }, "iniconfig": { "hashes": [ @@ -657,7 +648,7 @@ "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899", "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2" ], - "markers": "python_version < '4.0' and python_full_version >= '3.6.1'", + "markers": "python_version < '4' and python_full_version >= '3.6.1'", "version": "==5.9.3" }, "lazy-object-proxy": { @@ -891,38 +882,42 @@ }, "pyyaml": { "hashes": [ - "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf", - "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696", - "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393", - "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77", - "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922", - "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5", - "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8", - "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10", - "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc", - "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018", - "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e", - "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253", - "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347", - "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183", - "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541", - "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb", - "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185", - "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc", - "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db", - "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa", - "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46", - "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122", - "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b", - "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63", - "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df", - "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc", - "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247", - "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6", - "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0" + "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293", + "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b", + "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57", + "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b", + "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4", + "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07", + "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba", + "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9", + "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287", + "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513", + "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0", + "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0", + "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92", + "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f", + "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2", + "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc", + "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c", + "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86", + "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4", + "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c", + "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34", + "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b", + "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c", + "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb", + "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737", + "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3", + "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d", + "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53", + "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78", + "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803", + "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a", + "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174", + "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "version": "==5.4.1" + "markers": "python_version >= '3.6'", + "version": "==6.0" }, "requests": { "hashes": [ @@ -970,11 +965,11 @@ }, "stevedore": { "hashes": [ - "sha256:59b58edb7f57b11897f150475e7bc0c39c5381f0b8e3fa9f5c20ce6c89ec4aa1", - "sha256:920ce6259f0b2498aaa4545989536a27e4e4607b8318802d7ddc3a533d3d069e" + "sha256:a547de73308fd7e90075bb4d301405bebf705292fa90a90fc3bcf9133f58616c", + "sha256:f40253887d8712eaa2bb0ea3830374416736dc8ec0e22f5a65092c1174c44335" ], "markers": "python_version >= '3.6'", - "version": "==3.4.0" + "version": "==3.5.0" }, "toml": { "hashes": [ @@ -1003,9 +998,53 @@ }, "wrapt": { "hashes": [ - "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7" + "sha256:0473d1558b93e314e84313cc611f6c86be779369f9d3734302bf185a4d2625b1", + "sha256:0582180566e7a13030f896c2f1ac6a56134ab5f3c3f4c5538086f758b1caf3f2", + "sha256:15eee0e6fd07f48af2f66d0e6f2ff1916ffe9732d464d5e2390695296872cad9", + "sha256:1c5c4cf188b5643a97e87e2110bbd4f5bc491d54a5b90633837b34d5df6a03fe", + "sha256:1eb657ed84f4d3e6ad648483c8a80a0cf0a78922ef94caa87d327e2e1ad49b48", + "sha256:22142afab65daffc95863d78effcbd31c19a8003eca73de59f321ee77f73cadb", + "sha256:283e402e5357e104ac1e3fba5791220648e9af6fb14ad7d9cc059091af2b31d2", + "sha256:3de7b4d3066cc610054e7aa2c005645e308df2f92be730aae3a47d42e910566a", + "sha256:3e0d16eedc242d01a6f8cf0623e9cdc3b869329da3f97a15961d8864111d8cf0", + "sha256:3e33c138d1e3620b1e0cc6fd21e46c266393ed5dae0d595b7ed5a6b73ed57aa0", + "sha256:3f87042623530bcffea038f824b63084180513c21e2e977291a9a7e65a66f13b", + "sha256:53c6706a1bcfb6436f1625511b95b812798a6d2ccc51359cd791e33722b5ea32", + "sha256:593cb049ce1c391e0288523b30426c4430b26e74c7e6f6e2844bd99ac7ecc831", + "sha256:6e6d1a8eeef415d7fb29fe017de0e48f45e45efd2d1bfda28fc50b7b330859ef", + "sha256:724ed2bc9c91a2b9026e5adce310fa60c6e7c8760b03391445730b9789b9d108", + "sha256:728e2d9b7a99dd955d3426f237b940fc74017c4a39b125fec913f575619ddfe9", + "sha256:7574de567dcd4858a2ffdf403088d6df8738b0e1eabea220553abf7c9048f59e", + "sha256:8164069f775c698d15582bf6320a4f308c50d048c1c10cf7d7a341feaccf5df7", + "sha256:81a4cf257263b299263472d669692785f9c647e7dca01c18286b8f116dbf6b38", + "sha256:82223f72eba6f63eafca87a0f614495ae5aa0126fe54947e2b8c023969e9f2d7", + "sha256:8318088860968c07e741537030b1abdd8908ee2c71fbe4facdaade624a09e006", + "sha256:83f2793ec6f3ef513ad8d5b9586f5ee6081cad132e6eae2ecb7eac1cc3decae0", + "sha256:87ee3c73bdfb4367b26c57259995935501829f00c7b3eed373e2ad19ec21e4e4", + "sha256:8860c8011a6961a651b1b9f46fdbc589ab63b0a50d645f7d92659618a3655867", + "sha256:9adee1891253670575028279de8365c3a02d3489a74a66d774c321472939a0b1", + "sha256:a0cdedf681db878416c05e1831ec69691b0e6577ac7dca9d4f815632e3549580", + "sha256:a70d876c9aba12d3bd7f8f1b05b419322c6789beb717044eea2c8690d35cb91b", + "sha256:ada5e29e59e2feb710589ca1c79fd989b1dd94d27079dc1d199ec954a6ecc724", + "sha256:af9480de8e63c5f959a092047aaf3d7077422ded84695b3398f5d49254af3e90", + "sha256:b20703356cae1799080d0ad15085dc3213c1ac3f45e95afb9f12769b98231528", + "sha256:bc85d17d90201afd88e3d25421da805e4e135012b5d1f149e4de2981394b2a52", + "sha256:bff0a59387a0a2951cb869251257b6553663329a1b5525b5226cab8c88dcbe7e", + "sha256:c65e623ea7556e39c4f0818200a046cbba7575a6b570ff36122c276fdd30ab0a", + "sha256:c6ee5f8734820c21b9b8bf705e99faba87f21566d20626568eeb0d62cbeaf23c", + "sha256:c7ac2c7a8e34bd06710605b21dd1f3576764443d68e069d2afba9b116014d072", + "sha256:ccb34ce599cab7f36a4c90318697ead18312c67a9a76327b3f4f902af8f68ea1", + "sha256:d0d717e10f952df7ea41200c507cc7e24458f4c45b56c36ad418d2e79dacd1d4", + "sha256:d90520616fce71c05dedeac3a0fe9991605f0acacd276e5f821842e454485a70", + "sha256:dca56cc5963a5fd7c2aa8607017753f534ee514e09103a6c55d2db70b50e7447", + "sha256:df3eae297a5f1594d1feb790338120f717dac1fa7d6feed7b411f87e0f2401c7", + "sha256:e634136f700a21e1fcead0c137f433dde928979538c14907640607d43537d468", + "sha256:fbad5ba74c46517e6488149514b2e2348d40df88cd6b52a83855b7a8bf04723f", + "sha256:fbe6aebc9559fed7ea27de51c2bf5c25ba2a4156cf0017556f72883f2496ee9a", + "sha256:fdede980273aeca591ad354608778365a3a310e0ecdd7a3587b38bc5be9b1808" ], - "version": "==1.12.1" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==1.13.2" } } } From 9a1c85e543ad31699bdf662820a4fa8c0b68b85e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:41:31 +0000 Subject: [PATCH 22/32] Bump opencv-python-headless from 4.5.3.56 to 4.5.4.58 --- Pipfile | 2 +- Pipfile.lock | 55 ++++++++++++++++++++++++++-------------------------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/Pipfile b/Pipfile index eb1095c8..d5e82479 100644 --- a/Pipfile +++ b/Pipfile @@ -7,7 +7,7 @@ name = "pypi" numpy = "==1.21.3" scipy = "==1.7.1" scikit-image = "==0.18.3" -opencv-python-headless = "==4.5.3.56" +opencv-python-headless = "==4.5.4.58" deskew = "==0.10.36" jsonschema-gentypes = "==0.9.4" "ruamel.yaml" = "==0.17.4" diff --git a/Pipfile.lock b/Pipfile.lock index c36e9288..8c4da001 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "596a898a6cbae93c91b4a1d1b110e6d84b08a5c2f6df3b2e58f17df5aca57fa9" + "sha256": "3eae3ba61fe13c623e4722ea08f44b549cf93939d67a5433b18de42c87f6c50a" }, "pipfile-spec": 6, "requires": { @@ -210,33 +210,34 @@ }, "opencv-python-headless": { "hashes": [ - "sha256:0935bf569e2edc1af8bc38f00813e37b1ba63e4b2eb0dc48651f405068b8b36d", - "sha256:0e8080dc5baf6855b663634d9c7a45732e2999bbe44aa5e4a14c15f3631998e4", - "sha256:0ef768d119a00eb6be0ba7953ab875218084d078db564af89af2b3891b6d7a3b", - "sha256:0efe30ce934ec2ab7272143d17f68885910a715c6aeffd02973c04b3d8b99ca6", - "sha256:1a00d01d8d7250d6b87c63eb7b2df1e541fdb10919c22940cc53884bb12057c9", - "sha256:3308d22efec8a69932709fc76456ef7e0d1cd9eb2272d94b7e5df0674d3e324f", - "sha256:3599939dc61ab32c91cb2dbfd80a8199b53bf8a08cbb636ee9c2f27d74fe4f8f", - "sha256:39eaae19d5fa906c7ec2db76447c0ff9df6305633493f1b86e4c0080ed1cb036", - "sha256:3b1aa94894872e17a5fa07794562d8c44add78dd4c90a12fa1d946789e088784", - "sha256:465b157480902ecd6b2c4c46d547e4cfdec7595177bcc612c6f4c351966a5a1e", - "sha256:90686bd1292972ad47298154c8ad37543080b2fc0417b68a350d30232b77f670", - "sha256:b224afffbc4ea21fe100824ff08a79ad1fae3088c1280b8ff815067b827e5240", - "sha256:b563106e93525bd30072a27448cc2b5c11e45bf6025e74e1d40efd5349a31736", - "sha256:bfe8989ed4af5e14ef1480c89fe259f5d4bc66c5ae0e7d56d7c778ef6ebbcdf4", - "sha256:c54ad51bfc4623de287bd68f14f481f72300bd16a2d9e14850c1ef1a2dfc7dca", - "sha256:c7a1d365f2f8ce413847479a2d39bee2be6d5027119b08c4c5f6594f1f57673d", - "sha256:d4c784339c366d27d0b4503a073c97a7cd78657937b3755fdbc9168a002f6409", - "sha256:d70f3a44fb25f555da36e6c242cd1dffac6c4637eb900584f2a70a46e8e3cf05", - "sha256:e19ba664cae0bc6ad39e2fbf3b3f16c93009132f792dcb7ca0105f0cc15997ed", - "sha256:ebfeaff7e0bb1c293008a49b2b2c033a7cec3805006a8284fa1a44ad8c30446b", - "sha256:ecd84834f58daf94d3a4874a11997180380ef9af11b1fd5f81dbb8599b3c3446", - "sha256:f1082f4f15a681b435686ed3fc0232128a222fed6792a47fae5cf081eb751ccf", - "sha256:fc9fa0fa88423c0e74db52fe13939aa506789f924a2a879e31f1d415e39a0db2", - "sha256:fd0f0629e27d97eec2f51500afbe0845876fdcd89d412035f4d7beb618c51066" + "sha256:014e4a892f67043610521e673883da5ad98a6e61356a609c6502b9d22144f2f1", + "sha256:01a6411eb9eecf58db3a50fa761f0527bdd2b23b884b3bea44eb57e6d06e4767", + "sha256:067e4736cdc70712f43c064bfe53ba80492c20479ad3290849337f948572c392", + "sha256:09b21c48144a9dd82e435d66ccd834f3a391a2cd2b69f787aabbc7cd3576f2f1", + "sha256:1162de92301d0d13642afe8e163593982d3159ef21eba95a56ba3f5ca8024861", + "sha256:1799ae397677bd3a68aff4eb4f5c122baf3ee73a26fe67391e0d618bd2b7d046", + "sha256:1e0498bc4a39d887e84801b82df5cc943a5ae4b596511da7e69df64b263f293b", + "sha256:27b9118b342dc464590ed233c7f468c8cb68ee0e5d9734d9b67fb0bc1b10abd6", + "sha256:32e1f478457adeea4e1a3d6baf33310331740cceffd83a2f34e00a7e5bae6407", + "sha256:37e20b1a0c623c7e01381668b83342387798d0f32ff8a7d7f3dd0ef127eb10fa", + "sha256:3e32018e65eabc9aab10c7a109be5f735cf2c3934a47025b6903dcec034d460b", + "sha256:526417214a1cad27e3d2d064e535868ae05f5a07a0e344d54fe81078bbacfa57", + "sha256:540fa340b29dd86670e1f91bbcd2675df032b774f77d08909faf818696524617", + "sha256:64bfc55fe60ed9ad778ec73161f0cea58e425a3f2f06293756f82880319bffa9", + "sha256:69c55e055e81a2eead40e6f2521ad27bdd11523dc0c1de5e5aea23041a0a49f0", + "sha256:79ca8b8feab911a80692fa3871c02526844f112e0f8bf4749f78383696cfaa4c", + "sha256:807ac9d48c11b3f734d9de5eda69e1c4197204bac1e6db3d3d51859832df6fc1", + "sha256:84f037ba74482548c066ad5e341f77ebcd3d08d06a540a4a1182300045b8bde8", + "sha256:989d4817a2f22a601707ea36a3664a6c26cee155ed441363d5f29d73d9aec610", + "sha256:bb29a911c4a67f9710b53b94766be1bb22926b98460790091d4620a534329736", + "sha256:c8b595731b5c519daf2bf3c074ec2080eb51e8efef198a4493f930b5e4439bb0", + "sha256:d1735296d88e16379d001c4946c1a196b87e3c3ff4da0c10762918dded02f670", + "sha256:d73972a62d3e48ee01783d4eee01152c93348c70305c91f85fb668ddcc8907ad", + "sha256:dabf703efe12ec4341efd71c1dd384542e28fc49b7d2ea02f185ef22bb75a1c8", + "sha256:fdd80034749b8b2f211c2549293b34af691e4f90bf17b320a84b09b784275cc2" ], "index": "pypi", - "version": "==4.5.3.56" + "version": "==4.5.4.58" }, "pillow": { "hashes": [ @@ -648,7 +649,7 @@ "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899", "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2" ], - "markers": "python_version < '4' and python_full_version >= '3.6.1'", + "markers": "python_version < '4.0' and python_full_version >= '3.6.1'", "version": "==5.9.3" }, "lazy-object-proxy": { From 7d2aa9548a1b5d8fae401120745461be94f17515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 22 Oct 2021 16:02:39 +0200 Subject: [PATCH 23/32] Add ps2pdf post-processor to get smaller files --- Dockerfile | 2 +- scan_to_paperless/process.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3967e5a2..111048b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN \ apt install --assume-yes --no-install-recommends \ graphicsmagick pdftk-java \ tesseract-ocr tesseract-ocr-fra tesseract-ocr-deu tesseract-ocr-eng \ - libimage-exiftool-perl software-properties-common python3-pip && \ + libimage-exiftool-perl software-properties-common python3-pip ghostscript && \ apt clean && \ rm --recursive --force /var/lib/apt/lists/* /root/.cache /var/cache/* diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 45df9b0e..ead3855d 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -1044,11 +1044,15 @@ def finalize( call(CONVERT + [img, "+repage", file_name]) pdf.append(file_name) - call(["pdftk"] + pdf + ["output", destination, "compress"]) + intermediate_file = os.path.join(root_folder, "intermediate.pdf") + call(["pdftk"] + pdf + ["output", intermediate_file, "compress"]) + exiftool_cmd = ["exiftool", "-overwrite_original_in_place"] - exiftool_cmd.append(destination) + exiftool_cmd.append(intermediate_file) call(exiftool_cmd) + call(["ps2pdf", intermediate_file, destination]) + def write_error(root_folder: str, message: str) -> None: """Write the exception in an error file.""" From 418dd7d618a2f49c56a97c1bfd98f8362e0c7b96 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Oct 2021 14:19:01 +0000 Subject: [PATCH 24/32] Bump c2cciutils from 1.1.dev20211021112135 to 1.1.dev20211022130135 --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index 2ba527d9..5ecdefce 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,2 +1,2 @@ -c2cciutils==1.1.dev20211021112135 +c2cciutils==1.1.dev20211022130135 jsonschema2md==0.2.1 From 1076849f068df51b7dc3793696271b4eb7bb59f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Sat, 23 Oct 2021 07:59:42 +0200 Subject: [PATCH 25/32] More logs --- scan_to_paperless/process.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 45df9b0e..a8567a0f 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -1050,15 +1050,6 @@ def finalize( call(exiftool_cmd) -def write_error(root_folder: str, message: str) -> None: - """Write the exception in an error file.""" - if not os.path.exists(os.path.join(root_folder, "error.yaml")): - yaml = YAML(typ="safe") - yaml.default_flow_style = False - with open(os.path.join(root_folder, "error.yaml"), "w", encoding="utf-8") as error_file: - yaml.dump({"error": message}, error_file) - - def is_sources_present(images: List[str], root_folder: str) -> bool: """Are sources present for the next step.""" for img in images: @@ -1169,20 +1160,25 @@ def main() -> None: pass except Exception as exception: print(exception) + trace = traceback.format_exc() + print(trace) print_waiting = True yaml = YAML(typ="safe") yaml.default_flow_style = False try: with open(os.path.join(root_folder, "error.yaml"), "w", encoding="utf-8") as error_file: yaml.dump( - {"error": exception, "traceback": traceback.format_exc().split("\n")}, + {"error": str(exception), "traceback": trace.split("\n")}, error_file, ) except Exception as exception2: print(exception2) + print(traceback.format_exc()) + yaml = YAML() + yaml.default_flow_style = False with open(os.path.join(root_folder, "error.yaml"), "w", encoding="utf-8") as error_file: yaml.dump( - {"error": str(exception2), "traceback": traceback.format_exc().split("\n")}, + {"error": str(exception), "traceback": trace.split("\n")}, error_file, ) From 2faad0c8cd3e986ec272d3d05143d26f92ea3525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Sat, 23 Oct 2021 11:03:46 +0200 Subject: [PATCH 26/32] Fix for None angle --- scan_to_paperless/process.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 61e85471..3da786c6 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -476,7 +476,8 @@ def deskew(context: Context) -> None: for current_angles in angles: for current_angle in current_angles: - float_angles.add(nice_angle(float(current_angle))) + if current_angle is not None: + float_angles.add(nice_angle(float(current_angle))) for current_angle in float_angles: draw_angle(image, current_angle, (0, 255, 0)) image_status["angles"] = list(float_angles) From e510665a1a5be08639cb35cc9bb75bdb761de480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Sat, 23 Oct 2021 11:53:56 +0200 Subject: [PATCH 27/32] More informations in error.yaml --- scan_to_paperless/process.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 3da786c6..1ba2025a 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -1168,24 +1168,31 @@ def main() -> None: trace = traceback.format_exc() print(trace) print_waiting = True + + out = {"error": str(exception), "traceback": trace.split("\n")} + if hasattr("returncode", exception): + out["returncode"] = exception.returncode + if hasattr("cmd", exception): + out["cmd"] = exception.cmd + if hasattr("output", exception): + out["output"] = exception.output + if hasattr("stdout", exception): + out["stdout"] = exception.stdout + if hasattr("stderr", exception): + out["stderr"] = exception.stderr + yaml = YAML(typ="safe") yaml.default_flow_style = False try: with open(os.path.join(root_folder, "error.yaml"), "w", encoding="utf-8") as error_file: - yaml.dump( - {"error": str(exception), "traceback": trace.split("\n")}, - error_file, - ) + yaml.dump(out, error_file) except Exception as exception2: print(exception2) print(traceback.format_exc()) yaml = YAML() yaml.default_flow_style = False with open(os.path.join(root_folder, "error.yaml"), "w", encoding="utf-8") as error_file: - yaml.dump( - {"error": str(exception), "traceback": trace.split("\n")}, - error_file, - ) + yaml.dump(out, error_file) sys.stdout.flush() if not dirty: From 5d5f2aed5d4b300d6529ed98a0b965e5c1acecc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Sat, 23 Oct 2021 13:11:41 +0200 Subject: [PATCH 28/32] Fix more informations in error.yaml --- scan_to_paperless/process.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 1ba2025a..0b4ea692 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -1170,16 +1170,9 @@ def main() -> None: print_waiting = True out = {"error": str(exception), "traceback": trace.split("\n")} - if hasattr("returncode", exception): - out["returncode"] = exception.returncode - if hasattr("cmd", exception): - out["cmd"] = exception.cmd - if hasattr("output", exception): - out["output"] = exception.output - if hasattr("stdout", exception): - out["stdout"] = exception.stdout - if hasattr("stderr", exception): - out["stderr"] = exception.stderr + for attribute in ("returncode", "cmd", "output", "stdout", "stderr"): + if hasattr(exception, attribute): + out[attribute] = getattr(exception, attribute) yaml = YAML(typ="safe") yaml.default_flow_style = False From 32459fb1f7cc0a8797f4fc402ef7d7f6da45e027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Sat, 23 Oct 2021 13:30:35 +0200 Subject: [PATCH 29/32] Better messages --- scan_to_paperless/process.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 0b4ea692..58d317fe 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -1170,9 +1170,13 @@ def main() -> None: print_waiting = True out = {"error": str(exception), "traceback": trace.split("\n")} - for attribute in ("returncode", "cmd", "output", "stdout", "stderr"): + for attribute in ("returncode", "cmd"): if hasattr(exception, attribute): out[attribute] = getattr(exception, attribute) + for attribute in ("output", "stdout", "stderr"): + if hasattr(exception, attribute): + if getattr(exception, attribute): + out[attribute] = getattr(exception, attribute).decode() yaml = YAML(typ="safe") yaml.default_flow_style = False From 2130fecdf56536f6c4e658a9056722ce4c7ca3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Sat, 23 Oct 2021 13:48:54 +0200 Subject: [PATCH 30/32] Fix nan error --- scan_to_paperless/process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 58d317fe..01cf4a62 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -476,7 +476,7 @@ def deskew(context: Context) -> None: for current_angles in angles: for current_angle in current_angles: - if current_angle is not None: + if current_angle is not None and math.isfinite(float(current_angle)): float_angles.add(nice_angle(float(current_angle))) for current_angle in float_angles: draw_angle(image, current_angle, (0, 255, 0)) From 945f2670b50e586cd46fb6a1e4e63824540c818d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Sat, 23 Oct 2021 14:33:06 +0200 Subject: [PATCH 31/32] Fix nan error --- scan_to_paperless/process.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 01cf4a62..1b73f10a 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -472,7 +472,8 @@ def deskew(context: Context) -> None: image_status["average_deviation"] = average_deviation_float average_deviation2 = nice_angle(average_deviation_float - 45) image_status["average_deviation2"] = average_deviation2 - float_angles.add(average_deviation2) + if math.isfinite(average_deviation2): + float_angles.add(average_deviation2) for current_angles in angles: for current_angle in current_angles: From d4d868225e546c647eb52fc6f4936a25594681ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Sat, 23 Oct 2021 14:42:40 +0200 Subject: [PATCH 32/32] Try to fix Tesseract run that return an empty file --- scan_to_paperless/process.py | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 1b73f10a..8e7a7522 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -28,8 +28,10 @@ if TYPE_CHECKING: NpNdarrayInt = np.ndarray[np.uint8, Any] + CompletedProcess = subprocess.CompletedProcess[str] # pylint: disable=unsubscriptable-object else: NpNdarrayInt = np.ndarray + CompletedProcess = subprocess.CompletedProcess # dither, crop, append, repage CONVERT = ["gm", "convert"] @@ -181,7 +183,16 @@ def call(cmd: Union[str, List[str]], **kwargs: Any) -> None: cmd = [str(element) for element in cmd] print(" ".join(cmd) if isinstance(cmd, list) else cmd) sys.stdout.flush() - subprocess.check_output(cmd, stderr=subprocess.PIPE, **kwargs) # nosec + subprocess.check_call(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, **kwargs) # nosec + + +def run(cmd: Union[str, List[str]], **kwargs: Any) -> CompletedProcess: + """Verbose version of check_output with no returns.""" + if isinstance(cmd, list): + cmd = [str(element) for element in cmd] + print(" ".join(cmd) if isinstance(cmd, list) else cmd) + sys.stdout.flush() + return subprocess.run(cmd, stderr=subprocess.PIPE, check=True, **kwargs) # nosec def output(cmd: Union[str, List[str]], **kwargs: Any) -> str: @@ -1037,11 +1048,20 @@ def finalize( name = os.path.splitext(os.path.basename(img))[0] file_name = os.path.join(root_folder, f"{name}.pdf") if config["args"].get("tesseract", True): - call( - f'tesseract -l {config["args"].get("tesseract_lang", "fra+eng")} {img} stdout pdf' - f" > {file_name}", - shell=True, # nosec - ) + with open(file_name, "w", encoding="utf8") as output_file: + process = run( + [ + "tesseract", + "-l", + config["args"].get("tesseract_lang", "fra+eng"), + img, + "stdout", + "pdf", + ], + stdout=output_file, + ) + if process.stderr: + print(process.stderr) else: call(CONVERT + [img, "+repage", file_name]) pdf.append(file_name)