From 1d44cfd1274c614e975e196840ec5c86f6402dfc Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 9 May 2026 03:12:14 +0200 Subject: [PATCH] saip/batch: add blacklist to to_csv_rows() Change-Id: I5e567e59a007cf4b5d75a4dcea5371ff4404bf24 --- pySim/esim/saip/batch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pySim/esim/saip/batch.py b/pySim/esim/saip/batch.py index 1d135624..8d477e25 100644 --- a/pySim/esim/saip/batch.py +++ b/pySim/esim/saip/batch.py @@ -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: