mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Support list[str] for leaf entries in core/project_folder_structure settings to define folder names instead of requiring dicts with empty values
This commit is contained in:
parent
eec161ed15
commit
1ec9106f01
1 changed files with 8 additions and 0 deletions
|
|
@ -82,6 +82,14 @@ def create_project_folders(project_name, basic_paths=None):
|
|||
|
||||
def _list_path_items(folder_structure):
|
||||
output = []
|
||||
|
||||
# Allow leaf folders of the `project_folder_structure` to use a list of
|
||||
# strings instead of a dictionary of keys with empty values.
|
||||
if isinstance(folder_structure, list):
|
||||
assert all(isinstance(item, str) for item in folder_structure)
|
||||
return [folder_structure]
|
||||
|
||||
# Process key, value as key for folder names and value its subfolders
|
||||
for key, value in folder_structure.items():
|
||||
if not value:
|
||||
output.append(key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue