Get path string for a resource file. Tries relative path first, falls back to absolute path. Args: file_path: Path to the resource file. Returns: Path string (relative if possible, absolute otherwise).
(self, file_path: Path)
| 470 | ] |
| 471 | |
| 472 | def _get_resource_path(self, file_path: Path) -> str: |
| 473 | """ |
| 474 | Get path string for a resource file. |
| 475 | |
| 476 | Tries relative path first, falls back to absolute path. |
| 477 | |
| 478 | Args: |
| 479 | file_path: Path to the resource file. |
| 480 | |
| 481 | Returns: |
| 482 | Path string (relative if possible, absolute otherwise). |
| 483 | """ |
| 484 | resolved_path = file_path.resolve() |
| 485 | try: |
| 486 | return str(resolved_path.relative_to(self.root_path.resolve())) |
| 487 | except ValueError: |
| 488 | # Path is not under root_path, use absolute path |
| 489 | return str(resolved_path) |
| 490 | |
| 491 | def load_scripts(self, names: List[str] = None) -> List[Dict[str, Any]]: |
| 492 | """ |
no test coverage detected