Normalize fullwidth punctuation to ASCII across codebase.

Add scripts/normalize_ambiguous_unicode.py; fix corrupted patch_instance_theme_templates.py. Preserves curly quotes in string literals; removes Git homoglyph warnings on .env.example.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-08 23:42:26 +08:00
parent aaa72c7961
commit b733e551a0
392 changed files with 71522 additions and 71369 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
"""OKX 期权模块Flask 路由注册"""
"""OKX 期权模块:Flask 路由注册."""
from __future__ import annotations
import os
@@ -124,7 +124,7 @@ def _build_cfg(app_module: Any) -> dict[str, Any]:
def _require_options_ex(cfg: dict[str, Any]):
if not cfg.get("enabled"):
return None, "期权模块未启用请在 .env 设置 OKX_OPTIONS_ENABLED=true 并重启 PM2"
return None, "期权模块未启用,请在 .env 设置 OKX_OPTIONS_ENABLED=true 并重启 PM2"
ex = cfg.get("exchange_options")
ok, reason = cfg["options_api_ready"](ex)
if not ok:
@@ -227,7 +227,7 @@ def register_options_routes(app: Flask, cfg: dict[str, Any]) -> None:
return jsonify(q)
ask = q.get("ask")
if ask is None or ask <= 0:
return jsonify({"ok": False, "msg": "暂无卖一价无法买入"})
return jsonify({"ok": False, "msg": "暂无卖一价,无法买入"})
ct_mult = float(q.get("ct_mult") or 0.01)
min_sz = int(q.get("min_sz") or 1)
eth_amount = None
@@ -341,7 +341,7 @@ def register_options_routes(app: Flask, cfg: dict[str, Any]) -> None:
q = cfg["quote_option_contract"](ex, inst_id)
bid = q.get("bid")
if not use_market and (bid is None or bid <= 0):
return jsonify({"ok": False, "msg": "暂无买一价无法限价平仓"})
return jsonify({"ok": False, "msg": "暂无买一价,无法限价平仓"})
raw_positions = cfg["fetch_option_positions"](ex)
pos = next((p for p in raw_positions if str(p.get("instId")) == inst_id), None)
if not pos: