| Total Complexity | 2 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import inspect |
||
| 2 | import pathlib |
||
| 3 | from collections.abc import Mapping |
||
| 4 | |||
| 5 | |||
| 6 | def current_file() -> pathlib.Path: |
||
| 7 | """Returns current file name""" |
||
| 8 | return pathlib.Path(inspect.getfile(inspect.currentframe().f_back)) |
||
| 9 | |||
| 10 | |||
| 11 | paths_mapping: Mapping[str, pathlib.Path] = {p.name: p for p in current_file().parent.iterdir() if p.is_dir()} |
||
| 12 | |||
| 13 | |||
| 14 | def get_static_path(relative_path: str) -> pathlib.Path: |
||
| 15 | return paths_mapping['static'] / relative_path |
||
| 16 |