Skip to content

Commit

Permalink
Add ability to generate lists in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
noahbroyles committed Jan 7, 2023
1 parent 1c62801 commit a3c42ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion secsie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,14 @@ def generate_config(conf_obj: dict) -> str:
if isinstance(value, dict):
conf += f"\n[{key.replace(' ', '')}]\n"
for k, v in value.items():
conf += f"{';' if v == '' else ''}\t{k} = {v}\n"
if isinstance(v, list):
conf += f'\t{k} = {", ".join(v)}\n'
else:
conf += f"{';' if v == '' else ''}\t{k} = {v}\n"
conf += "\n"
continue
elif isinstance(value, list):
conf += f'{key} = {", ".join(value)}\n'
conf += f"{key} = {value}\n"

return conf
Expand Down

0 comments on commit a3c42ac

Please sign in to comment.