Skip to content
Snippets Groups Projects
Commit 4824b333 authored by Emmanuel Viennet's avatar Emmanuel Viennet
Browse files

Ameliore generation doc API

parent f87ed3bb
No related branches found
No related tags found
No related merge requests found
...@@ -854,7 +854,13 @@ def _gen_csv_line(doc_line: dict) -> str: ...@@ -854,7 +854,13 @@ def _gen_csv_line(doc_line: dict) -> str:
samples: list[str] = doc_line.get("samples", []) samples: list[str] = doc_line.get("samples", [])
csv_lines: list[str] = [] csv_lines: list[str] = []
for sample in samples: for sample in samples:
url, content = sample.split(";", maxsplit=1) fragments = sample.split(";", maxsplit=1)
if len(fragments) == 2:
url, content = fragments
elif len(fragments) == 1:
url, content = fragments[0], ""
else:
raise ValueError(f"Error: sample invalide: {sample}")
csv_line = f'"{entry_name}";"{url}";"{permission}";"{method}";' csv_line = f'"{entry_name}";"{url}";"{permission}";"{method}";'
if content: if content:
csv_line += f'"{content}"' csv_line += f'"{content}"'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment