(items, columns, relroot=None)
| 80 | |
| 81 | |
| 82 | def _render_table(items, columns, relroot=None): |
| 83 | # XXX improve this |
| 84 | header = '\t'.join(columns) |
| 85 | div = '--------------------' |
| 86 | yield header |
| 87 | yield div |
| 88 | total = 0 |
| 89 | for item in items: |
| 90 | rowdata = item.render_rowdata(columns) |
| 91 | row = [rowdata[c] for c in columns] |
| 92 | if relroot and 'file' in columns: |
| 93 | index = columns.index('file') |
| 94 | row[index] = os.path.relpath(row[index], relroot) |
| 95 | yield '\t'.join(row) |
| 96 | total += 1 |
| 97 | yield div |
| 98 | yield f'total: {total}' |
| 99 | |
| 100 | |
| 101 | def build_section(name, groupitems, *, relroot=None): |
no test coverage detected
searching dependent graphs…