rename bison_theme_use_browser -> bison_use_browser

This commit is contained in:
felinae98
2024-05-06 19:12:46 +08:00
parent d8f48fc490
commit cf50e9f288
9 changed files with 13 additions and 11 deletions
+3 -1
View File
@@ -14,7 +14,9 @@ class PlugConfig(BaseModel):
default=False,
description="发送消息时将所有文本转换为图片,防止风控,仅需要推送文转图可以为 platform 指定 theme",
)
bison_theme_use_browser: bool = Field(default=False, description="是否允许主题使用浏览器")
bison_use_browser: bool = Field(
default=False, description="是否使用环境中的浏览器", alias="bison_theme_use_browser"
)
bison_init_filter: bool = True
bison_use_queue: bool = True
bison_outer_url: str = ""
+1 -1
View File
@@ -11,7 +11,7 @@ class ThemeManager:
logger.trace(f"Registering theme: {theme}")
if theme.name in self.__themes:
raise ThemeRegistrationError(f"Theme {theme.name} duplicated registration")
if theme.need_browser and not plugin_config.bison_theme_use_browser:
if theme.need_browser and not plugin_config.bison_use_browser:
logger.opt(colors=True).warning(f"Theme <b><u>{theme.name}</u></b> requires browser, but not allowed")
self.__themes[theme.name] = theme
logger.opt(colors=True).success(f"Theme <b><u>{theme.name}</u></b> registered")
+2 -2
View File
@@ -23,8 +23,8 @@ class Theme(ABC, BaseModel):
async def is_support_render(self, post: "AbstractPost") -> bool:
"""是否支持渲染该类型的Post"""
if self.need_browser and not plugin_config.bison_theme_use_browser:
logger.warning(f"Theme {self.name} need browser, but `bison_theme_use_browser` is False")
if self.need_browser and not plugin_config.bison_use_browser:
logger.warning(f"Theme {self.name} need browser, but `bison_use_browser` is False")
return False
return True