优化代码

This commit is contained in:
HibiKier
2022-12-04 16:46:33 +08:00
parent 994484f3b0
commit 31e4cadecb
18 changed files with 483 additions and 325 deletions
+25 -2
View File
@@ -1,12 +1,28 @@
from typing import List, Tuple
from typing import List, Tuple, Dict, Optional, Union
from configs.path_config import IMAGE_PATH
from utils.image_utils import BuildImage
from pydantic import BaseModel
import os
import random
background_path = IMAGE_PATH / "background" / "help" / "simple_help"
# class PluginType(BaseModel):
#
#
# class Plugin(BaseModel):
# name: str
# plugin_type: PluginType # 插件内部类型,根据name [Hidden] [Admin] [SUPERUSER]
# usage: Optional[str]
# des: Optional[str]
# cmd: Optional[List[str]]
# task: Optional[Dict[str, str]]
# type: Optional[Tuple[str, int]] # 菜单类型
# version: Optional[Union[str, int]]
# author: Optional[str]
async def build_help_image(image_group: List[List[BuildImage]], h: int):
bk = None
@@ -103,3 +119,10 @@ def group_image(image_list: List[BuildImage]) -> Tuple[List[List[BuildImage]], i
max_w -= max([x.w for x in image_group[-1]])
image_group.pop(-1)
return image_group, max(max_h + 250, max_w + 70)
# class HelpImageBuild:
#
# def __init__(self):
# self._data: Dict[str, List[]] = {}