From b0f151445784d4d00fca9f48e1f49c3090607344 Mon Sep 17 00:00:00 2001 From: grabowski Date: Mon, 27 Oct 2025 12:32:20 +0700 Subject: [PATCH] Fix f-string syntax error in template generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Split template writing into two parts to avoid f-string parsing issues - Write version comment separately using f-string - Write rest of template using regular string (avoids escaping CSS/JS braces) - Fixes SyntaxError: f-string: expecting '=', or '!', or ':', or '}' The issue occurred because CSS contains { } braces and % characters that f-strings try to interpret. Now only the version comment uses f-string. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- rotary_phone_web.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rotary_phone_web.py b/rotary_phone_web.py index 07e4c86..6c77b33 100644 --- a/rotary_phone_web.py +++ b/rotary_phone_web.py @@ -961,10 +961,11 @@ def main(): print(f"Creating new template at {template_file}") with open(template_file, 'w') as f: - f.write(f''' + # Write version comment first, then the rest of the template + f.write(f'\n') + f.write(''' - Rotary Phone Control Panel