Look up a project's path by name. Args: name: The project name. Returns: The project Path, or None if not found.
(name: str)
| 318 | |
| 319 | |
| 320 | def get_project_path(name: str) -> Path | None: |
| 321 | """ |
| 322 | Look up a project's path by name. |
| 323 | |
| 324 | Args: |
| 325 | name: The project name. |
| 326 | |
| 327 | Returns: |
| 328 | The project Path, or None if not found. |
| 329 | """ |
| 330 | _, SessionLocal = _get_engine() |
| 331 | session = SessionLocal() |
| 332 | try: |
| 333 | project = session.query(Project).filter(Project.name == name).first() |
| 334 | if project is None: |
| 335 | return None |
| 336 | return Path(project.path) |
| 337 | finally: |
| 338 | session.close() |
| 339 | |
| 340 | |
| 341 | def list_registered_projects() -> dict[str, dict[str, Any]]: |
no test coverage detected