MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get_data_dir_paths

Method get_data_dir_paths

src/bonsai/bonsai/tool/blender.py:1791–1803  ·  view source on GitHub ↗

Return paths based on glob pattern from the provided path in data folder. Return paths from internal data folder first and then paths from the user data folder (if it exists).

(cls, relative_dir_path: Union[str, Path], glob_pattern: str)

Source from the content-addressed store, hash-verified

1789
1790 @classmethod
1791 def get_data_dir_paths(cls, relative_dir_path: Union[str, Path], glob_pattern: str) -> Generator[Path, None, None]:
1792 """Return paths based on glob pattern from the provided path in data folder.
1793 Return paths from internal data folder first and then paths from the user data folder (if it exists)."""
1794 custom_path = cls.get_user_data_dir() / relative_dir_path
1795 if custom_path.is_dir():
1796 for filepath in custom_path.glob(glob_pattern):
1797 yield filepath
1798
1799 default_data_dir = cls.get_internal_data_dir()
1800 if default_data_dir == custom_path:
1801 return
1802 for filepath in (default_data_dir / relative_dir_path).glob(glob_pattern):
1803 yield filepath
1804
1805 @classmethod
1806 def setup_user_data_dir(cls) -> None:

Callers 6

load_pset_templatesMethod · 0.80
update_library_fileFunction · 0.80
library_fileMethod · 0.80
template_fileMethod · 0.80
titleblocksMethod · 0.80

Calls 2

get_user_data_dirMethod · 0.80
get_internal_data_dirMethod · 0.80

Tested by

no test coverage detected