Whether a given path is within the package's data directory. This method can be used together with load_data_with_path(name) to determine if data has been loaded from a file bundled with the package, as opposed to a file in a separate location. :type path: str
(self, path)
| 471 | yield full_path |
| 472 | |
| 473 | def is_builtin_path(self, path): |
| 474 | """Whether a given path is within the package's data directory. |
| 475 | |
| 476 | This method can be used together with load_data_with_path(name) |
| 477 | to determine if data has been loaded from a file bundled with the |
| 478 | package, as opposed to a file in a separate location. |
| 479 | |
| 480 | :type path: str |
| 481 | :param path: The file path to check. |
| 482 | |
| 483 | :return: Whether the given path is within the package's data directory. |
| 484 | """ |
| 485 | path = os.path.expanduser(os.path.expandvars(path)) |
| 486 | return path.startswith(self.BUILTIN_DATA_PATH) |
| 487 | |
| 488 | |
| 489 | class ExtrasProcessor: |
no outgoing calls