INNER CODE UNIT · Python
style_recipe
ChenShuo2004/cs-board · webapp/server.py:244
def style_recipe(style: str) -> str:
for item in load_custom_styles():
if item.get("name") == style or style in item.get("aliases", []):
return str(item.get("recipe") or "")
if style in STYLE_PRESETS:
return STYLE_PRESETS[style]
raise RuntimeError(f"后台未加载画面风格:{style},请重启后台后重新提交任务")
def normalized_style_name(value: Any) -> str:
return re.sub(r"\s+", " ", str(value or "")).strip()[:40]
def normalized_style_description(value: Any) -> str:
return re.sub(r"\s+", " ", str(value or "")).strip()[:100]
def normalized_style_recipe(value: Any) -> str: