Split waste_schedule.py in two

This commit is contained in:
Edward Betts 2024-07-14 22:19:13 +08:00
parent 17eca6a95a
commit 0f3f596cb3
5 changed files with 107 additions and 93 deletions

View file

@ -77,3 +77,10 @@ def get_most_recent_file(directory: str, ext: str) -> str | None:
return None
existing.sort(reverse=True)
return os.path.join(directory, existing[0][1])
def make_waste_dir(data_dir: str) -> None:
"""Make waste dir if missing."""
waste_dir = os.path.join(data_dir, "waste")
if not os.path.exists(waste_dir):
os.mkdir(waste_dir)