forked from ScoDoc/ScoDoc
Ameliore generation doc API
This commit is contained in:
parent
f87ed3bb68
commit
4824b33358
@ -854,7 +854,13 @@ def _gen_csv_line(doc_line: dict) -> str:
|
||||
samples: list[str] = doc_line.get("samples", [])
|
||||
csv_lines: list[str] = []
|
||||
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}";'
|
||||
if content:
|
||||
csv_line += f'"{content}"'
|
||||
|
Loading…
Reference in New Issue
Block a user