Skip to content
Snippets Groups Projects
Commit ccd0fb50 authored by Bastien Abadie's avatar Bastien Abadie
Browse files

A bot more robust csv parsing

parent df5f54fc
No related branches found
No related tags found
1 merge request!26Import surfaces
......@@ -142,7 +142,11 @@ class SurfaceImporter(object):
with open(self.csvpath) as csvfile:
reader = csv.reader(csvfile, delimiter=';')
next(reader) # Skip header
self.csvdata = [CSVRow._make(row[:3]) for row in reader if len(row[0]) > 0]
self.csvdata = [
CSVRow(*row[:3])
for row in reader
if row and len(row[0]) > 0
]
self.raw_volume_names = set(row.volume_name for row in self.csvdata)
self.raw_folios = set((row.volume_name, row.folio) for row in self.csvdata)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment