Skip to content
Snippets Groups Projects
Verified Commit 15b0afae authored by Daniel Hornung's avatar Daniel Hornung
Browse files

WIP: Filling XLSX

parent 9324ba7a
No related branches found
No related tags found
2 merge requests!100WIP: Filling XLSX: Seems to be working.,!93Filling XLSX: Everything except multiple choice.
Pipeline #48180 passed
......@@ -153,18 +153,23 @@ data: dict
The data at the current path position. Must be single items (dict or simple scalar) or lists of
simple values.
"""
sheet = self._sheet_index[".".join(current_path)].sheet
sheet_meta = self._sheet_index[".".join(current_path)]
sheet = sheet_meta.sheet
next_row = _next_row_index(sheet)
for name, content in data.items():
if isinstance(content, list):
# TODO handle later
# scalar elements: semicolon separated
# nested dicts: recurse
continue
if isinstance(content, dict):
pass
# from IPython import embed
# embed()
elif isinstance(content, dict):
pass
# scalars
else:
path = current_path + [name]
path_str = ".".join([ColumnType.SCALAR.name] + path)
col_index = sheet_meta.col_index[path_str].col_index
sheet.cell(row=next_row+1, column=col_index+1, value=content)
def fill_template(data: Union[dict, str, TextIO], template: str, result: str) -> None:
......
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