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 ...@@ -153,18 +153,23 @@ data: dict
The data at the current path position. Must be single items (dict or simple scalar) or lists of The data at the current path position. Must be single items (dict or simple scalar) or lists of
simple values. 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) next_row = _next_row_index(sheet)
for name, content in data.items(): for name, content in data.items():
if isinstance(content, list): if isinstance(content, list):
# TODO handle later # TODO handle later
# scalar elements: semicolon separated # scalar elements: semicolon separated
# nested dicts: recurse # nested dicts: recurse
continue
if isinstance(content, dict):
pass pass
# from IPython import embed elif isinstance(content, dict):
# embed() 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: 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