doctor & stat improvements

- doctor: log when there is no stats() function and suggest to use it
- check that stats() result isn't None
- warn when there is not data in the iterable
This commit is contained in:
Dima Gerasimov 2020-10-31 17:00:01 +00:00 committed by karlicoss
parent 2619af7ae7
commit ed4b6c409f
2 changed files with 10 additions and 1 deletions

View file

@ -212,10 +212,13 @@ def modules_check(args):
info(f'{color.GREEN}OK{color.RESET} : {m:<50}')
stats = get_stats(m)
if stats is None:
eprint(" - no 'stats' function, can't check the data")
# todo point to a readme on the module structure or something?
continue
try:
res = stats()
assert res is not None, 'stats() returned None'
except Exception as ee:
warning(f' - {color.RED}stats:{color.RESET} computing failed{vw}')
if verbose: