Skip to content
Snippets Groups Projects

WIP: Reforma importů

Closed Martin Mareš requested to merge mj/import into master
1 unresolved thread
+ 7
3
@@ -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 != '-':
setattr(row, f, x)
rows.append(row)
if x != "" and x != '-':
not_empty = True
if f in columns:
setattr(row, f, x)
if not_empty:
rows.append(row)
return rows
Loading