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)
| 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: |
no test coverage detected