From e53830b4bf7c0f7b7999860e3a2cdc03a03544c7 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Wed, 27 Oct 2021 21:51:50 +0800 Subject: Implement CsvTable._append --- jimbrella/csv_table.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jimbrella/csv_table.py b/jimbrella/csv_table.py index 6f431a7..3c420ff 100644 --- a/jimbrella/csv_table.py +++ b/jimbrella/csv_table.py @@ -86,8 +86,15 @@ class CsvTable: self.lockfile.unlock() + def _append(self, row) -> list: + """Append one row, and return the entire updated table.""" + rows = self._read() + rows.append(row) + self._write(rows) + return rows + def _update(self, update: dict) -> list: - """Update status of one row, and return the entire updated table.""" + """Update one row, and return the entire updated table.""" rows = self._read() index_column = self.schema[0]["name"] for idx, row in enumerate(rows): -- cgit v1.2.3