Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mozillazg/hello-python-plugin

尝试实现简单的插件功能。
https://github.com/mozillazg/hello-python-plugin

Last synced: 13 days ago
JSON representation

尝试实现简单的插件功能。

Awesome Lists containing this project

README

        

#尝试实现简单的插件功能

$ python main.py -h
usage: main.py [-h] [--enable PLUGINS]

optional arguments:
-h, --help show this help message and exit
--enable PLUGINS enable some plugins (default: [])

默认输出:

$ python main.py
Default: test plugin.

启用插件 foo:

$ python main.py --enable foo
Default: test plugin.
Plugin foo: test plugin.

启用插件 foo, bar:

$ python main.py --enable foo --enable bar
Default: test plugin.
Plugin bar: test plugin.
Plugin foo: test plugin.