From 80dce6e1de96bbd0597f3838134a5493fb086d75 Mon Sep 17 00:00:00 2001 From: fujie Date: Wed, 11 Feb 2026 11:58:44 +0800 Subject: [PATCH] fix: compatibility with Python < 3.12 for f-strings with backslashes --- scripts/openwebui_stats.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/openwebui_stats.py b/scripts/openwebui_stats.py index e021592..679ecb2 100644 --- a/scripts/openwebui_stats.py +++ b/scripts/openwebui_stats.py @@ -267,7 +267,9 @@ class OpenWebUIStats: # 只取最近 14 天的数据用于展示 data = history[-14:] dates = [item["date"][-5:] for item in data] # 只取 MM-DD + dates_str = ", ".join([f'"{d}"' for d in dates]) downloads = [str(item["total_downloads"]) for item in data] + downloads_str = ", ".join(downloads) mm = [] mm.append("### 📈 增长趋势 (14天)") @@ -275,9 +277,9 @@ class OpenWebUIStats: mm.append("```mermaid") mm.append("xychart-beta") mm.append(f' title "Downloads Trend"') - mm.append(f" x-axis [{', '.join(f'\"{d}\"' for d in dates)}]") + mm.append(f" x-axis [{dates_str}]") mm.append(f' y-axis "Downloads"') - mm.append(f" line [{', '.join(downloads)}]") + mm.append(f" line [{downloads_str}]") mm.append("```") mm.append("") return "\n".join(mm)