插件源数据
PluginManifest
每个插件必须定义 PluginManifest,并挂载到 PLUGIN.manifest 上,用于描述插件的静态信息。
Tip
推荐以插件 identifier 作为文件名,例如 sample.py 对应 identifier="sample"。
from app.plugins import PluginManifest, PluginKind
manifest = PluginManifest(
identifier="sample",
name="示例插件",
version="0.1.0",
description="演示如何集成 Little Tree Wallpaper Next 插件 API",
author="Your Name",
homepage="https://example.com",
permissions=("resource_data",), # 可选,需要访问受保护数据时声明
dependencies=("core>=1.0.0",), # 可选,支持简单的版本比较运算符
kind=PluginKind.FEATURE, # 可选,可声明为 PluginKind.LIBRARY
)字段说明:
| 字段 | 说明 |
|---|---|
identifier | 插件唯一标识符(用于存储目录、日志等),建议使用小写字母和下划线 |
name | 插件显示名称 |
version | 插件版本号,采用语义化版本 |
description | 可选,插件简介 |
author | 可选,作者信息 |
homepage | 可选,主页或文档链接 |
permissions | 可选,列出插件启动前需要授予的权限标识符 |
dependencies | 可选,列出依赖的其他插件 identifier,可使用 core>=1.0.0、helper==0.2 这样的语法描述版本要求 |
kind | 可选,插件类型,默认 PluginKind.FEATURE,当插件仅提供 API/库能力时可设为 PluginKind.LIBRARY |
访问 manifest.short_label() 可获得 name + version 的组合字符串。