From 3c79675ba24a9dc8bb49195477b868b15d0ca37f Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Fri, 3 Dec 2021 13:19:03 +0000 Subject: [PATCH] Remove unused properties in Spreadsheet class These are no longer used anywhere. Note that pyexcel-xlsx is still a necessary dependency: it acts as an implicit plugin to pyexcel that, surprisingly, allows pyexcel to...read excel files [1]. [1]: https://github.com/pyexcel/pyexcel-xlsx#as-a-pyexcel-plugin --- app/models/spreadsheet.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/app/models/spreadsheet.py b/app/models/spreadsheet.py index 3621d4e93..7b66a7b0f 100644 --- a/app/models/spreadsheet.py +++ b/app/models/spreadsheet.py @@ -1,9 +1,8 @@ import csv -from io import BytesIO, StringIO +from io import StringIO from os import path import pyexcel -import pyexcel_xlsx class Spreadsheet(): @@ -87,19 +86,3 @@ class Spreadsheet(): form.file.data, filename=form.file.data.filename, ) - - @property - def as_rows(self): - if not self._rows: - self._rows = list(csv.reader( - StringIO(self._csv_data), - quoting=csv.QUOTE_MINIMAL, - skipinitialspace=True, - )) - return self._rows - - @property - def as_excel_file(self): - io = BytesIO() - pyexcel_xlsx.save_data(io, {'Sheet 1': self.as_rows}) - return io.getvalue()