From ebe0c5bcbb8a573ef792fc0ff5b755c7e3f7ce5c Mon Sep 17 00:00:00 2001 From: snowy Date: Sat, 24 Aug 2024 11:39:10 +0800 Subject: [PATCH] =?UTF-8?q?:package:=20=E6=8F=92=E4=BB=B6=E5=95=86?= =?UTF-8?q?=E5=BA=97=E4=B8=8A=E6=96=B0=EF=BC=9Aliteyukibot-plugin-htmlrend?= =?UTF-8?q?er=E5=8F=8Aliteyukibot-plugin-lagrange?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/public/assets/plugins.json | 53 ++++++++++++++++++ EN.LICENSE => liteyuki/EN.LICENSE | 62 +++++++++++----------- MIT-LSO-AGC.LICENSE => liteyuki/LICENSE | 0 liteyuki/config.py | 44 +-------------- liteyuki/py.typed | 0 src/nonebot_plugins/liteyuki_status/api.py | 3 +- 6 files changed, 88 insertions(+), 74 deletions(-) rename EN.LICENSE => liteyuki/EN.LICENSE (98%) rename MIT-LSO-AGC.LICENSE => liteyuki/LICENSE (100%) create mode 100644 liteyuki/py.typed diff --git a/docs/.vuepress/public/assets/plugins.json b/docs/.vuepress/public/assets/plugins.json index d24deb4a..433b996a 100644 --- a/docs/.vuepress/public/assets/plugins.json +++ b/docs/.vuepress/public/assets/plugins.json @@ -38,5 +38,58 @@ "type": "application", "valid": true, "version": "rolling" + }, + { + "module_name": "liteyukibot-plugin-lagrange", + "project_link": "liteyukibot-plugin-lagrange", + "name": "LagrangePlugin", + "desc": "在轻雪中使用lagrange-python!", + "author": "snowykami", + "homepage": "https://github.com/snowykami/liteyukibot-plugin-lagrange", + "tags": [ + { + "label": "app", + "color": "#aeeaa8" + }, + { + "label": "lagrange", + "color": "#ff89f7" + } + ], + "is_official": true, + "type": "application", + "valid": true, + "version": "rolling" + }, + { + "module_name": "liteyukibot-plugin-htmlrender", + "project_link": "liteyukibot-plugin-htmlrender", + "name": "htmlrender", + "desc": "使用系统中的浏览器对网页进行渲染,便于其他插件使用", + "author": "EillesWan", + "homepage": "https://github.com/LiteyukiStudio/liteyukibot-plugin-htmlrender", + "tags": [ + { + "label": "ch", + "color": "#4285f4" + }, + { + "label": "ro", + "color": "#db4437" + }, + { + "label": "mi", + "color": "#f4b400" + }, + { + "label": "um", + "color": "#0f9d58" + + } + ], + "is_official": true, + "type": "application", + "valid": true, + "version": "rolling" } ] diff --git a/EN.LICENSE b/liteyuki/EN.LICENSE similarity index 98% rename from EN.LICENSE rename to liteyuki/EN.LICENSE index bda5bef5..bfd019ab 100644 --- a/EN.LICENSE +++ b/liteyuki/EN.LICENSE @@ -1,31 +1,31 @@ -LSO license -LiteyukiStudio Opensource license - ---- - -Copyright © 2024 Snowykami - ---- - -Free to grant the same license-based rights to any person or organization who obtains a copy - -including but not limited to using, copying, modifying, merging, publishing, distributing, sublicenseing, and/or selling copies of the software - -This software and related documentation files (hereinafter referred to as "this software") are licensed in the same way as the base, and are released in the form of open source on the Internet or other media platforms - -Everyone has the right to obtain a copy and obtain permission to distribute and/or use it in the above manner - -However, when obtaining a copy, it is still necessary to pay attention to the following: - -- The above copyright notice and this permission notice shall be included in a copy of the Software - - When using this software and its copies, it is still necessary to maintain the same form as the original - -- When using this software, you still need to disclose the copy of this software under the same license: - - Do not profit from copies of this software in a non-original license without the permission of the original author - ---- - -The software is provided as a "copy as is" without any warranty of any kind, either express or implied: -including but not limited to the warranty of merchantability, non-infringement for specific purposes - -In any case, the author or copyright owner shall not be liable for any claims, damages, or other liabilities arising from the use of the software by the author or copyright owner, whether in contract litigation, infringement litigation, or other litigation. The author and its copyright owner have the right to refuse compensation for any losses caused by the user for personal reasons +LSO license +LiteyukiStudio Opensource license + +--- + +Copyright © 2024 Snowykami + +--- + +Free to grant the same license-based rights to any person or organization who obtains a copy + +including but not limited to using, copying, modifying, merging, publishing, distributing, sublicenseing, and/or selling copies of the software + +This software and related documentation files (hereinafter referred to as "this software") are licensed in the same way as the base, and are released in the form of open source on the Internet or other media platforms + +Everyone has the right to obtain a copy and obtain permission to distribute and/or use it in the above manner + +However, when obtaining a copy, it is still necessary to pay attention to the following: + +- The above copyright notice and this permission notice shall be included in a copy of the Software + - When using this software and its copies, it is still necessary to maintain the same form as the original + +- When using this software, you still need to disclose the copy of this software under the same license: + - Do not profit from copies of this software in a non-original license without the permission of the original author + +--- + +The software is provided as a "copy as is" without any warranty of any kind, either express or implied: +including but not limited to the warranty of merchantability, non-infringement for specific purposes + +In any case, the author or copyright owner shall not be liable for any claims, damages, or other liabilities arising from the use of the software by the author or copyright owner, whether in contract litigation, infringement litigation, or other litigation. The author and its copyright owner have the right to refuse compensation for any losses caused by the user for personal reasons diff --git a/MIT-LSO-AGC.LICENSE b/liteyuki/LICENSE similarity index 100% rename from MIT-LSO-AGC.LICENSE rename to liteyuki/LICENSE diff --git a/liteyuki/config.py b/liteyuki/config.py index ed328c37..3ab5ad2d 100644 --- a/liteyuki/config.py +++ b/liteyuki/config.py @@ -11,56 +11,16 @@ import os import json import copy -import platform -from typing import Any, List - import toml import yaml -from pydantic import BaseModel + +from typing import Any from liteyuki.log import logger _SUPPORTED_CONFIG_FORMATS = (".yaml", ".yml", ".json", ".toml") -# 以下这三个 Config 和 src/utils/base/config.py 中重复 -# 应尽快整理 - - -class SatoriNodeConfig(BaseModel): - host: str = "" - port: str = "5500" - path: str = "" - token: str = "" - - -class SatoriConfig(BaseModel): - comment: str = ( - "These features are still in development. Do not enable in production environment." - ) - enable: bool = False - hosts: List[SatoriNodeConfig] = [SatoriNodeConfig()] - - -class BasicConfig(BaseModel): - host: str = "127.0.0.1" - port: int = 20216 - superusers: list[str] = [] - command_start: list[str] = ["/", ""] - nickname: list[str] = [f"LiteyukiBot"] - satori: SatoriConfig = SatoriConfig() - data_path: str = "data/liteyuki" - chromium_path: str = ( - "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" # type: ignore - if platform.system() == "Darwin" - else ( - "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" - if platform.system() == "Windows" - else "/usr/bin/chromium-browser" - ) - ) - - def flat_config(config: dict[str, Any]) -> dict[str, Any]: """ 扁平化配置文件 diff --git a/liteyuki/py.typed b/liteyuki/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/src/nonebot_plugins/liteyuki_status/api.py b/src/nonebot_plugins/liteyuki_status/api.py index beb7c85c..5dee12db 100644 --- a/src/nonebot_plugins/liteyuki_status/api.py +++ b/src/nonebot_plugins/liteyuki_status/api.py @@ -7,7 +7,8 @@ from cpuinfo import cpuinfo from nonebot import require from nonebot.adapters import satori -from src.utils import __NAME__, __VERSION__ +from src.utils import __NAME__ +from liteyuki import __version__ from src.utils.base.config import get_config from src.utils.base.data_manager import TempConfig, common_db from src.utils.base.language import Language