Skip to content

Commit

Permalink
Correct error for CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsamuelwrites committed Mar 6, 2021
1 parent 90cda8c commit a447b21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# v0.8 (in progress)
# v0.9
===============================================================================
* Correct error related to handling of CSV files

# v0.8
===============================================================================
* Add support for spreadsheet files (.ods, .xls, .xlsx)
* Apply pycodestyle (PEP8)
Expand Down
6 changes: 5 additions & 1 deletion shexstatements/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ def generateshex():
if ".csv" == file_extension.lower():
shex = CSV.generate_shex_from_csv(
shexstatements, delim=delim, filename=False)
else:
elif file_extension.lower() in {".ods", ".xls", ".xlsx"}:
shexstatements = request.files["csvfileupload"].stream.read(
)
shex = Spreadsheet.generate_shex_from_spreadsheet(
stream=shexstatements, filepath=filepath)
else:
shex = CSV.generate_shex_from_csv(
shexstatements, delim=delim, filename=False)

data["input"] = shexstatements
data["output"] = shex
return render_template('shexstatements.html', data=data)
Expand Down

0 comments on commit a447b21

Please sign in to comment.