Help you create a plugin for MSLX
Project description
MSLXPluginHelper
文件说明
PluginList.py
是从MSLX中提取的副本,您可以使用它在不下载MSLX的情况下进行插件的测试工作
example.py
是从MSLX中提取的示例插件,只会打印两句话
基础插件
-
首先,您应该编写
from MSLXPluginHelper.PluginList import RegisterPlugin
,这将导入用于插件函数的修饰器 -
然后,编写您的插件函数体,请务必接受一个page参数
-
使用
@RegisterPlugin
来修饰您的函数使其注册为一个MSLX插件,其需要三个参数-
第一个参数,应该传入页面的名称,下面是目前可用页面名称列表
main
主页面frpc
Frpc配置页面ng
Nginx配置页面set
软件设置页面login
登陆页面genpwd
创建密钥页面
-
第二个参数,应为插件加载的时机,可以为
before
或者after
二者之一 -
第三个参数,插件的信息,应该为一个字典,格式如下:
-
{
"name":"",
"author":"",
"description":"",
"version":"x.x.x"
}
这是一个可选参数,当不传入时系统会自动为其赋值:
{
"name":"AnonymousPlugin",
"author":"Anonymous",
"description":"",
"version":"1.0.0"
}
最后,您应该在发布时将所有MSLXPluginHelper.PluginList
替换为.PluginList
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
MSLXPluginHelper-0.0.1.tar.gz
(15.6 kB
view hashes)
Built Distribution
Close
Hashes for MSLXPluginHelper-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f70dca051f9ee5995151976881e8cb5bb263a2802f9223bb63ba566ffedab07 |
|
MD5 | 9208baff313beed4efe50a4dbc62d1ed |
|
BLAKE2b-256 | 6c3f58276087aaf7a9a5f3d9322f531f09c1ac8d3e872e070db987fcbbe638a0 |