Probably functional. Testing

This commit is contained in:
Test User
2025-10-23 19:29:26 +02:00
parent ab4b95c664
commit 245530389d
17 changed files with 657 additions and 108 deletions
-20
View File
@@ -9,24 +9,6 @@ from typing import Optional
class TemplateManager:
def __init__(self, templates_dir: Path):
self.templates_dir = templates_dir
if not templates_dir.exists():
templates_dir.mkdir(parents=True)
self._create_default_template()
def _create_default_template(self):
"""Create default template"""
default_template = {
"title": "heur|orig",
"created": "heur|orig",
"changed": "heur|orig",
"authors": "heur|orig",
"version": "heur|orig",
"tags": "orig|ai default"
}
with open(self.templates_dir / 'default.json', 'w', encoding='utf-8') as f:
json.dump(default_template, f, indent=2)
def load_template(self, name: str) -> dict:
"""Load template by name"""
@@ -35,8 +17,6 @@ class TemplateManager:
if not template_path.exists():
# Fallback to default
template_path = self.templates_dir / 'default.json'
if not template_path.exists():
self._create_default_template()
with open(template_path, 'r', encoding='utf-8') as f:
return json.load(f)