diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2021-10-31 23:35:35 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-02-07 00:34:51 +0100 |
| commit | 214f6aa6553ecdfa11d2ec63bb1cef1a49e8538d (patch) | |
| tree | 1d81f5b56ac8c3b52a0839b3a87f87280309e7e3 /helpers.py | |
| parent | 7dbc6d60c4f8da78c2ed8f9e6dde694b5a9d0d3e (diff) | |
| download | quatuorbellefeuille.com-214f6aa6553ecdfa11d2ec63bb1cef1a49e8538d.tar.xz | |
Add simplified concerts syntax
Diffstat (limited to 'helpers.py')
| -rw-r--r-- | helpers.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/helpers.py b/helpers.py new file mode 100644 index 0000000..faf14e7 --- /dev/null +++ b/helpers.py @@ -0,0 +1,9 @@ +from os import path +from pathlib import Path + + +def relative_path(*, to, ref): + # pathlib.Path(x).relative_to(y) cannot handle y not being under x, + # os.path.dirname('x') yields '' rather than '.'. + # 😮💨 + return path.relpath(to, Path(ref).parent) |
