mirror of
https://github.com/Nezumi-2711/astrbot_plugin_qq_group_daily_analysis.git
synced 2026-09-23 04:09:59 +00:00
[fix] 兼容 linux 的 pdf 生成情况
This commit is contained in:
@@ -47,6 +47,45 @@ class PDFInstaller:
|
||||
logger.error(f"安装 pyppeteer 时出错: {e}")
|
||||
return f"❌ 安装过程中出错: {str(e)}"
|
||||
|
||||
@staticmethod
|
||||
async def install_system_deps():
|
||||
"""安装系统依赖(仅提供指导)"""
|
||||
try:
|
||||
logger.info("提供系统依赖安装指导...")
|
||||
|
||||
if sys.platform.startswith('linux'):
|
||||
return """💡 Linux 系统依赖安装指导:
|
||||
|
||||
1. 安装 Chrome/Chromium 浏览器:
|
||||
Ubuntu/Debian: sudo apt-get install chromium-browser
|
||||
CentOS/RHEL: sudo yum install chromium
|
||||
Arch Linux: sudo pacman -S chromium
|
||||
|
||||
2. 安装完成后,重启 AstrBot
|
||||
|
||||
3. 如果仍然有问题,请检查系统日志"""
|
||||
|
||||
elif sys.platform.startswith('win'):
|
||||
return """💡 Windows 系统依赖安装指导:
|
||||
|
||||
1. 安装 Google Chrome 浏览器
|
||||
2. 重启 AstrBot
|
||||
3. 如果仍然有问题,请检查系统日志"""
|
||||
|
||||
elif sys.platform.startswith('darwin'):
|
||||
return """💡 macOS 系统依赖安装指导:
|
||||
|
||||
1. 安装 Google Chrome 浏览器
|
||||
2. 重启 AstrBot
|
||||
3. 如果仍然有问题,请检查系统日志"""
|
||||
|
||||
else:
|
||||
return "💡 请安装 Chrome 或 Chromium 浏览器,然后重启 AstrBot"
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"提供系统依赖指导时出错: {e}")
|
||||
return f"❌ 提供指导时出错: {str(e)}"
|
||||
|
||||
@staticmethod
|
||||
def get_pdf_status(config_manager) -> str:
|
||||
"""获取PDF功能状态"""
|
||||
|
||||
Reference in New Issue
Block a user