mirror of
https://github.com/searxng/searxng.git
synced 2024-11-22 12:10:11 +01:00
checker: display results at the end
This commit is contained in:
parent
08e7c37a35
commit
1a66bfa66c
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user