From c3bdbfbc0875d0ce77303e613671fea4ce50c3a9 Mon Sep 17 00:00:00 2001 From: William Moore Date: Thu, 29 Aug 2024 10:21:01 +0100 Subject: [PATCH] Revert "resave main() returns nothing to indicate no error" This reverts commit 448016ef02861acfff3cb8f5c42266497bca0d11. --- src/ome2024_ngff_challenge/resave.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ome2024_ngff_challenge/resave.py b/src/ome2024_ngff_challenge/resave.py index 022bf53..586f2f1 100755 --- a/src/ome2024_ngff_challenge/resave.py +++ b/src/ome2024_ngff_challenge/resave.py @@ -406,9 +406,10 @@ def write( config.zr_write_text(filename, text) -def main(ns: argparse.Namespace) -> None: +def main(ns: argparse.Namespace) -> int: """ - If no images are converted, raises SystemExit. + If no images are converted, raises + SystemExit. Otherwise, return the number of images. """ converted: int = 0 @@ -549,6 +550,7 @@ def main(ns: argparse.Namespace) -> None: if converted == 0: raise SystemExit(1) + return converted def cli(subparsers: argparse._SubParsersAction):