Linted code iwht black tool
This commit is contained in:
@@ -11,6 +11,7 @@ from typing import Dict
|
||||
|
||||
class TemplateNotFoundError(Exception):
|
||||
"""Raised when a template file cannot be found."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -42,11 +43,11 @@ def load_template(name: str, **kwargs) -> str:
|
||||
"""
|
||||
# debug
|
||||
# print(f"Loading Template: {name}")
|
||||
|
||||
|
||||
# Check cache first
|
||||
if name not in _template_cache:
|
||||
# Determine file path based on whether name has an extension
|
||||
if '.' in name:
|
||||
if "." in name:
|
||||
file_path = _TEMPLATE_DIR / name
|
||||
else:
|
||||
file_path = _TEMPLATE_DIR / f"{name}.html"
|
||||
@@ -54,7 +55,7 @@ def load_template(name: str, **kwargs) -> str:
|
||||
if not file_path.exists():
|
||||
raise TemplateNotFoundError(f"Template '{name}' not found at {file_path}")
|
||||
|
||||
_template_cache[name] = file_path.read_text(encoding='utf-8')
|
||||
_template_cache[name] = file_path.read_text(encoding="utf-8")
|
||||
|
||||
template = _template_cache[name]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user