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

ENH: Making missing paths.

parent c0b27ba5
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 #48275 passed
......@@ -23,6 +23,7 @@
from __future__ import annotations
import json
import pathlib
from collections import OrderedDict
from types import SimpleNamespace
from typing import Any, Dict, List, Optional, Union, TextIO
......@@ -358,4 +359,7 @@ validation_schema: dict, optional
result_wb = load_workbook(template)
template_filler = TemplateFiller(result_wb)
template_filler.fill_data(data=data)
parentpath = pathlib.Path(result).parent
parentpath.mkdir(parents=True, exist_ok=True)
result_wb.save(result)
......@@ -23,6 +23,8 @@
"""
This module allows to generate template tables from JSON schemas.
"""
import pathlib
import re
from abc import ABC, abstractmethod
from enum import Enum
......@@ -279,6 +281,8 @@ class XLSXTemplateGenerator(TableTemplateGenerator):
"""
sheets = self._generate_sheets_from_schema(schema, foreign_keys)
wb = self._create_workbook_from_sheets_def(sheets)
parentpath = pathlib.Path(filepath).parent
parentpath.mkdir(parents=True, exist_ok=True)
wb.save(filepath)
@staticmethod
......
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