mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-06-10 00:35:50 +03:00
saip/batch: add blacklist to to_csv_rows()
Change-Id: I5e567e59a007cf4b5d75a4dcea5371ff4404bf24
This commit is contained in:
@@ -325,12 +325,15 @@ class BatchAudit(list):
|
||||
|
||||
return batch_audit
|
||||
|
||||
def to_csv_rows(self, headers=True, sort_key=None):
|
||||
def to_csv_rows(self, headers=True, sort_key=None, column_blacklist=None):
|
||||
'''generator that yields all audits' values as rows, useful feed to a csv.writer.'''
|
||||
columns = set()
|
||||
for audit in self:
|
||||
columns.update(audit.keys())
|
||||
|
||||
if column_blacklist:
|
||||
columns.difference_update(set(column_blacklist))
|
||||
|
||||
columns = tuple(sorted(columns, key=sort_key))
|
||||
|
||||
if headers:
|
||||
|
||||
Reference in New Issue
Block a user