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

STY: Enhanced styling

parent b18c5df8
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 #49062 failed
......@@ -36,8 +36,8 @@ unittest:
pytest-3 unittests
style:
pycodestyle --count src unittests --exclude=swagger_client
autopep8 -ar --diff --exit-code --exclude swagger_client .
pycodestyle --count --exclude=swagger_client src unittests
autopep8 -ar --diff --exit-code --exclude swagger_client src unittests
.PHONY: style
lint:
......
......@@ -214,7 +214,8 @@ class TableTemplateGenerator(ABC):
internal_key = p2s(array_path + [foreign])
if internal_key in sheets[sheetname]:
raise ValueError("The schema would lead to two columns with the same "
f"name, which is forbidden:\n{foreign} -> {internal_key}")
"name, which is forbidden:\n"
f"{foreign} -> {internal_key}")
ref_sheet = p2s(array_path)
sheets[sheetname][internal_key] = (
ColumnType.FOREIGN, f"see sheet '{ref_sheet}'", array_path + [foreign])
......
......@@ -217,7 +217,7 @@ def test_template_generator():
schema = json.load(sfi)
fk_path = os.path.join(di, "foreign_keys"+fi[len('schema'):])
path = os.path.join(di, "template"+fi[len('schema'):-4]+"xlsx")
allreadydone = [
alreadydone = [
"Präventionsmaßnahmen",
"Beratungsstellen",
"Schutzeinrichtungen",
......@@ -230,7 +230,7 @@ def test_template_generator():
"Polizeilicher Opferschutz",
"Feedback",
]
if any([path.startswith("template_"+k) for k in allreadydone]):
if any([path.startswith("template_"+k) for k in alreadydone]):
continue
if not os.path.exists(fk_path):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment