Add blank workbook template, example rules file, and Create blank workbook button
build-container / build (push) Successful in 33s
build-container / build (push) Successful in 33s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6f4ecd42f7
commit
6073279a1b
9 files changed
+27
-2
No files matched your search
@@ -155,6 +155,13 @@ class H(BaseHTTPRequestHandler):
|
||||
keep = L.BACKUPS / f"before_undo_{dt.datetime.now():%Y%m%d_%H%M%S}.xlsx"
|
||||
shutil.copy2(L.WORKBOOK, keep); shutil.copy2(b[-1], L.WORKBOOK)
|
||||
return self._send(200, {"message": f"Restored the workbook from {b[-1].name}."})
|
||||
if u.path == "/api/create_blank":
|
||||
tpl = HERE / "template" / "Bills_Tracker.template.xlsx"
|
||||
with LOCK:
|
||||
if L.WORKBOOK.exists(): return self._send(400, {"error": "Bills_Tracker.xlsx already exists; it won't be overwritten."})
|
||||
if not tpl.exists(): return self._send(400, {"error": "Template not found in the app."})
|
||||
DATA.mkdir(parents=True, exist_ok=True); shutil.copy2(tpl, L.WORKBOOK)
|
||||
return self._send(200, {"message": "Created a blank Bills_Tracker.xlsx. Now drop your statements in."})
|
||||
if u.path == "/api/open":
|
||||
if sys.platform != "darwin": return self._send(200, {"message": "Open Bills_Tracker.xlsx from the data folder on the host."})
|
||||
subprocess.run(["open", str(L.WORKBOOK)], check=False)
|
||||
|
||||
Reference in new issue
Block a user