From 1a66bfa66c5dd1e1fcfceee5703700b8e6e00424 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Fri, 1 Mar 2024 09:30:43 +0100 Subject: [PATCH] checker: display results at the end --- searx/search/checker/__main__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/searx/search/checker/__main__.py b/searx/search/checker/__main__.py index 15fcb5ebd..340c27187 100644 --- a/searx/search/checker/__main__.py +++ b/searx/search/checker/__main__.py @@ -55,7 +55,7 @@ def iter_processor(engine_name_list): if processor is not None: yield name, processor else: - stdout.write(f'{BOLD_SEQ}Engine {name:30}{RESET_SEQ}{RED}Engine does not exist{RESET_SEQ}') + stdout.write(f'{BOLD_SEQ}Engine {name:30}{RESET_SEQ}{RED}Engine does not exist{RESET_SEQ}\n') else: for name, processor in searx.search.PROCESSORS.items(): yield name, processor @@ -64,12 +64,17 @@ def iter_processor(engine_name_list): # actual check & display def run(engine_name_list, verbose): searx.search.initialize() + name_checker_list = [] for name, processor in iter_processor(engine_name_list): stdout.write(f'{BOLD_SEQ}Engine {name:30}{RESET_SEQ}Checking\n') if not sys.stdout.isatty(): stderr.write(f'{BOLD_SEQ}Engine {name:30}{RESET_SEQ}Checking\n') checker = searx.search.checker.Checker(processor) checker.run() + name_checker_list.append((name, checker)) + + stdout.write(f'\n== {BOLD_SEQ}Results{RESET_SEQ} ' + '=' * 70 + '\n') + for name, checker in name_checker_list: if checker.test_results.successful: stdout.write(f'{BOLD_SEQ}Engine {name:30}{RESET_SEQ}{GREEN}OK{RESET_SEQ}\n') if verbose: