Split out inheritance flags formatting

This commit is contained in:
Mike McLean 2018-10-03 15:26:19 -04:00 committed by Tomas Kopecek
parent 106be174b4
commit d53fefa640
2 changed files with 18 additions and 12 deletions

View file

@ -636,3 +636,18 @@ def _list_tasks(options, session):
t['sub'] = True
return tasklist
def format_inheritance_flags(parent):
"""Return a human readable string of inheritance flags"""
flags = ''
for code,expr in (
('M', parent['maxdepth'] is not None),
('F', parent['pkg_filter']),
('I', parent['intransitive']),
('N', parent['noconfig']),):
if expr:
flags += code
else:
flags += '.'
return flags