Skip to content
Snippets Groups Projects
Commit 79a6baa5 authored by Martin Mareš's avatar Martin Mareš
Browse files

mo.csv: Ignorujeme prázdné řádky

parent e729607d
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !15. Comments created here will be created in the context of that merge request.
......@@ -116,11 +116,15 @@ def read(file: IO, fmt: FileFormat, row_class: Type[Row]):
header = r
else:
row = row_class()
not_empty = False
for i in range(min(len(r), len(header))):
f = header[i]
x = r[i].strip()
if f in columns and x != "" and x != '-':
if x != "" and x != '-':
not_empty = True
if f in columns:
setattr(row, f, x)
if not_empty:
rows.append(row)
return rows
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment