mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 01:48:26 -04:00
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
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
import csv
|
import csv
|
||||||
from io import BytesIO, StringIO
|
from io import StringIO
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
import pyexcel
|
import pyexcel
|
||||||
import pyexcel_xlsx
|
|
||||||
|
|
||||||
|
|
||||||
class Spreadsheet():
|
class Spreadsheet():
|
||||||
@@ -87,19 +86,3 @@ class Spreadsheet():
|
|||||||
form.file.data,
|
form.file.data,
|
||||||
filename=form.file.data.filename,
|
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()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user