KingHacker9000 commited on
Commit
9e16acb
·
1 Parent(s): d0a8a94

Fix cfg-before-assignment; move expected_svg debug block

Browse files
Files changed (1) hide show
  1. wai_service.py +8 -8
wai_service.py CHANGED
@@ -46,14 +46,6 @@ def handler(payload: dict) -> str:
46
  os.makedirs(init_dir, exist_ok=True)
47
  logging.warning("Created missing directory %s", init_dir)
48
 
49
- # The SVG path that preprocessing expects
50
- expected_svg = os.path.join(
51
- "code", "data", "init",
52
- f"{cfg.font}_{cfg.optimized_letter}_scaled.svg"
53
- )
54
- if not os.path.exists(expected_svg):
55
- logging.warning("Expected seed SVG not found: %s (will be generated)", expected_svg)
56
-
57
 
58
  tmp_token_path = None # ➋
59
  if "token" in payload:
@@ -81,6 +73,14 @@ def handler(payload: dict) -> str:
81
  os.unlink(tmp_token_path.name) # remove temp file
82
 
83
  _sanitize(cfg)
 
 
 
 
 
 
 
 
84
 
85
  # 2️⃣ Overlay ALL payload keys (new ones like render_size stick)
86
  for k, v in payload.items():
 
46
  os.makedirs(init_dir, exist_ok=True)
47
  logging.warning("Created missing directory %s", init_dir)
48
 
 
 
 
 
 
 
 
 
49
 
50
  tmp_token_path = None # ➋
51
  if "token" in payload:
 
73
  os.unlink(tmp_token_path.name) # remove temp file
74
 
75
  _sanitize(cfg)
76
+
77
+ # The SVG path that preprocessing expects
78
+ expected_svg = os.path.join(
79
+ "code", "data", "init",
80
+ f"{cfg.font}_{cfg.optimized_letter}_scaled.svg"
81
+ )
82
+ if not os.path.exists(expected_svg):
83
+ logging.warning("Expected seed SVG not found: %s (will be generated)", expected_svg)
84
 
85
  # 2️⃣ Overlay ALL payload keys (new ones like render_size stick)
86
  for k, v in payload.items():