Return ``~/.opentrace/``, creating it with restricted permissions if needed.
()
| 51 | |
| 52 | |
| 53 | def _base_dir() -> Path: |
| 54 | """Return ``~/.opentrace/``, creating it with restricted permissions if needed.""" |
| 55 | d = Path.home() / _OPENTRACE_DIR |
| 56 | if not d.exists(): |
| 57 | d.mkdir(parents=True, exist_ok=True) |
| 58 | _secure_path(d) |
| 59 | return d |
| 60 | |
| 61 | |
| 62 | def _secure_path(path: Path) -> None: |
no test coverage detected