Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
298 B
2
Indexable
Never
from pathlib import Path

def tree_path_json(path: Path) -> dict:
	if path.is_dir():
		return {
			folder.resolve().name : [
				file.name
				for file in (folder / f'{folder.resolve().name}_.DS_Store/SVG').iterdir()
			]
			for folder in path.iterdir()
			if folder.is_dir()
		}
	else:
		return {}