(tool: str, ext: str)
| 159 | |
| 160 | |
| 161 | def _get_path_func(tool: str, ext: str): |
| 162 | fmt = f"{tool}.dvc-{{now:%Y%m%d}}_{{now:%H%M%S}}.{ext}" |
| 163 | |
| 164 | def func(now: Optional["datetime"] = None) -> str: |
| 165 | return fmt.format(now=now or datetime.now()) # noqa: DTZ005 |
| 166 | |
| 167 | return func |
| 168 | |
| 169 | |
| 170 | @contextmanager |