blob: 56672b077e2df1829919f3beea4fe816d044bb2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import pathlib
import datetime
from serenitas.utils.env import DAILY_DIR
def get_dir(workdate: datetime.date, archived=True) -> pathlib.Path:
p = DAILY_DIR / str(workdate) / "Reports"
if not p.exists() and archived:
p = (
DAILY_DIR
/ str(workdate.year)
/ f"{workdate:%Y_%m}"
/ str(workdate)
/ "Reports"
)
return p
|