Rename report file and auto-delete previous reports
- Rename output to "YYYY-MM-DD HH-MM-SS Agenda + Požadavky.xlsx" - Delete old reports before generating new one Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,8 +40,14 @@ DB_CONFIG = {
|
|||||||
|
|
||||||
EXPORT_DIR = Path(r"z:\Dropbox\Ordinace\Reporty")
|
EXPORT_DIR = Path(r"z:\Dropbox\Ordinace\Reporty")
|
||||||
EXPORT_DIR.mkdir(exist_ok=True, parents=True)
|
EXPORT_DIR.mkdir(exist_ok=True, parents=True)
|
||||||
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
|
||||||
xlsx_path = EXPORT_DIR / f"{timestamp} Agenda + Pozadavky (Merged).xlsx"
|
# Delete previous reports
|
||||||
|
for old in EXPORT_DIR.glob("* Agenda + Požadavky.xlsx"):
|
||||||
|
old.unlink()
|
||||||
|
print(f"🗑️ Deleted old report: {old.name}")
|
||||||
|
|
||||||
|
timestamp = datetime.now().strftime("%Y-%m-%d %H-%M-%S")
|
||||||
|
xlsx_path = EXPORT_DIR / f"{timestamp} Agenda + Požadavky.xlsx"
|
||||||
|
|
||||||
# ==================== LOAD TOKEN ====================
|
# ==================== LOAD TOKEN ====================
|
||||||
TOKEN_PATH = Path("token.txt")
|
TOKEN_PATH = Path("token.txt")
|
||||||
|
|||||||
Reference in New Issue
Block a user