From 900cf6fa53e1c904ee1559f3746069c5daacf22e Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Thu, 28 Nov 2024 23:02:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E5=AF=B9zhenxun=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=B8=AE=E5=8A=A9=E8=BF=9B=E8=A1=8C=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B5=E9=9D=A2=E6=95=88=E6=9E=9C=20(#1748?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhenxun/builtin_plugins/help/zhenxun_help.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/zhenxun/builtin_plugins/help/zhenxun_help.py b/zhenxun/builtin_plugins/help/zhenxun_help.py index 427e39ec..7da89677 100644 --- a/zhenxun/builtin_plugins/help/zhenxun_help.py +++ b/zhenxun/builtin_plugins/help/zhenxun_help.py @@ -48,10 +48,8 @@ def build_plugin_data(classify: dict[str, list[Item]]) -> list[dict[str, str]]: 返回: list[dict[str, str]]: 前端插件数据 """ - - lengths = [len(classify[c]) for c in classify] - index = lengths.index(max(lengths)) - menu_key = list(classify.keys())[index] + classify = dict(sorted(classify.items(), key=lambda x: len(x[1]), reverse=True)) + menu_key = next(iter(classify.keys())) max_data = classify[menu_key] del classify[menu_key] plugin_list = [