refactored common logic for printing ignored entries
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from .consts import SYM_NOTHING, SYM_GOOD, SYM_BAD
|
||||
from .df import count_true
|
||||
from .seq import is_empty
|
||||
|
||||
|
||||
@ -22,6 +23,14 @@ def print_bad(*args, **kwargs):
|
||||
return print(SYM_BAD, *args, **kwargs)
|
||||
|
||||
|
||||
def print_ignored(df, which, reason): #TODO: should df be the argument or df.index?
|
||||
all_names = df.index
|
||||
ignored = all_names[~which]
|
||||
if not is_empty(ignored):
|
||||
print(f"ignored due to {reason}:")
|
||||
print(itemize(ignored))
|
||||
print()
|
||||
|
||||
def itemize(iterable, bullet="•"):
|
||||
if not bullet.endswith(" "):
|
||||
bullet += " "
|
||||
|
Reference in New Issue
Block a user