21 lines
657 B
Python
21 lines
657 B
Python
from pathlib import Path
|
|
from datetime import datetime
|
|
|
|
|
|
def get_capture_src_folder(device_path):
|
|
today_str = datetime.now().strftime('%Y-%m-%d')
|
|
capture_base_path = device_path / today_str
|
|
capture_base_path.mkdir(parents=True, exist_ok=True)
|
|
|
|
existing_captures = [d for d in capture_base_path.iterdir() if d.is_dir()]
|
|
nth_capture = len(existing_captures) + 1
|
|
capture_dir = capture_base_path / f'capture_{nth_capture}'
|
|
capture_dir.mkdir(parents=True, exist_ok=True)
|
|
|
|
return capture_dir
|
|
|
|
|
|
def make_capture_src_folder(capture_src_folder):
|
|
capture_src_folder.mkdir(parents=True, exist_ok=True)
|
|
return capture_src_folder
|