2024-08-12 02:40:51 +08:00
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
|
|
|
|
Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved
|
|
|
|
|
|
|
|
|
|
@Time : 2024/8/11 下午10:02
|
|
|
|
|
@Author : snowykami
|
|
|
|
|
@Email : snowykami@outlook.com
|
|
|
|
|
@File : __init__.py.py
|
|
|
|
|
@Software: PyCharm
|
|
|
|
|
"""
|
2024-08-18 01:25:11 +08:00
|
|
|
|
from liteyuki import get_config, load_plugin
|
2024-08-18 23:39:19 +08:00
|
|
|
|
from liteyuki.plugin import PluginMetadata, load_plugins, PluginType
|
2024-08-12 02:40:51 +08:00
|
|
|
|
|
|
|
|
|
__plugin_meta__ = PluginMetadata(
|
|
|
|
|
name="外部轻雪插件加载器",
|
2024-08-18 23:39:19 +08:00
|
|
|
|
description="插件加载器,用于加载轻雪原生插件",
|
|
|
|
|
type=PluginType.SERVICE
|
2024-08-12 02:40:51 +08:00
|
|
|
|
)
|
|
|
|
|
|
2024-08-12 05:26:36 +08:00
|
|
|
|
|
2024-08-16 21:38:22 +08:00
|
|
|
|
def default_plugins_loader():
|
|
|
|
|
"""
|
|
|
|
|
默认插件加载器,应在初始化时调用
|
|
|
|
|
"""
|
|
|
|
|
for plugin in get_config("liteyuki.plugins", []):
|
|
|
|
|
load_plugin(plugin)
|
|
|
|
|
|
2024-08-18 04:37:58 +08:00
|
|
|
|
for plugin_dir in get_config("liteyuki.plugin_dirs", ["src/liteyuki_plugins"]):
|
2024-08-16 21:38:22 +08:00
|
|
|
|
load_plugins(plugin_dir)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default_plugins_loader()
|