From f74933fa3cfc100280e2867fca23997734d5a83a Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:38:14 +0000 Subject: [PATCH] :rotating_light: make pyright happy --- nb_cli/cli/commands/adapter.py | 3 +- nb_cli/cli/commands/plugin.py | 3 +- nb_cli/locale/zh_CN/LC_MESSAGES/nb-cli.po | 36 +++++++++++------------ 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/nb_cli/cli/commands/adapter.py b/nb_cli/cli/commands/adapter.py index d0ec296..a73762c 100644 --- a/nb_cli/cli/commands/adapter.py +++ b/nb_cli/cli/commands/adapter.py @@ -197,7 +197,8 @@ async def create( try: output_dir = ( await ListPrompt( - _("Where to store the adapter?"), [*detected, Choice(_("Other"))] + _("Where to store the adapter?"), + [*detected, Choice[None](_("Other"))], ).prompt_async(style=CLI_DEFAULT_STYLE) ).name if output_dir == _("Other"): diff --git a/nb_cli/cli/commands/plugin.py b/nb_cli/cli/commands/plugin.py index a76dba6..a236a82 100644 --- a/nb_cli/cli/commands/plugin.py +++ b/nb_cli/cli/commands/plugin.py @@ -203,7 +203,8 @@ async def create( try: output_dir = ( await ListPrompt( - _("Where to store the plugin?"), [*detected, Choice(_("Other"))] + _("Where to store the plugin?"), + [*detected, Choice[None](_("Other"))], ).prompt_async(style=CLI_DEFAULT_STYLE) ).name if output_dir == _("Other"): diff --git a/nb_cli/locale/zh_CN/LC_MESSAGES/nb-cli.po b/nb_cli/locale/zh_CN/LC_MESSAGES/nb-cli.po index 1946532..abce30b 100644 --- a/nb_cli/locale/zh_CN/LC_MESSAGES/nb-cli.po +++ b/nb_cli/locale/zh_CN/LC_MESSAGES/nb-cli.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: nb-cli 1.0.0\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-09-08 08:07+0000\n" +"POT-Creation-Date: 2024-09-08 08:37+0000\n" "PO-Revision-Date: 2023-01-11 08:56+0000\n" "Last-Translator: FULL NAME \n" "Language: zh_Hans_CN\n" @@ -16,7 +16,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.14.0\n" +"Generated-By: Babel 2.16.0\n" #: nb_cli/cli/__init__.py:51 msgid "The working directory." @@ -118,22 +118,22 @@ msgstr "适配器名称:" msgid "Where to store the adapter?" msgstr "请输入适配器存储的位置:" -#: nb_cli/cli/commands/adapter.py:200 nb_cli/cli/commands/adapter.py:203 -#: nb_cli/cli/commands/plugin.py:206 nb_cli/cli/commands/plugin.py:209 +#: nb_cli/cli/commands/adapter.py:201 nb_cli/cli/commands/adapter.py:204 +#: nb_cli/cli/commands/plugin.py:207 nb_cli/cli/commands/plugin.py:210 msgid "Other" msgstr "其他" -#: nb_cli/cli/commands/adapter.py:205 nb_cli/cli/commands/adapter.py:214 -#: nb_cli/cli/commands/plugin.py:211 nb_cli/cli/commands/plugin.py:221 +#: nb_cli/cli/commands/adapter.py:206 nb_cli/cli/commands/adapter.py:215 +#: nb_cli/cli/commands/plugin.py:212 nb_cli/cli/commands/plugin.py:222 msgid "Output Dir:" msgstr "输出目录:" -#: nb_cli/cli/commands/adapter.py:211 nb_cli/cli/commands/plugin.py:218 +#: nb_cli/cli/commands/adapter.py:212 nb_cli/cli/commands/plugin.py:219 msgid "Output dir is not a directory!" msgstr "输出目录不是一个文件夹!" -#: nb_cli/cli/commands/adapter.py:216 nb_cli/cli/commands/plugin.py:213 -#: nb_cli/cli/commands/plugin.py:223 +#: nb_cli/cli/commands/adapter.py:217 nb_cli/cli/commands/plugin.py:214 +#: nb_cli/cli/commands/plugin.py:224 msgid "Invalid output dir!" msgstr "无效的输出目录!" @@ -421,36 +421,36 @@ msgstr "无法找到项目根目录! {config_file} 文件不存在." msgid "Using python: {python_path}" msgstr "使用 Python: {python_path}" -#: nb_cli/handlers/meta.py:85 +#: nb_cli/handlers/meta.py:81 msgid "Cannot find a valid Python interpreter." msgstr "无法找到可用的 Python 解释器." -#: nb_cli/handlers/meta.py:126 nb_cli/handlers/meta.py:135 +#: nb_cli/handlers/meta.py:122 nb_cli/handlers/meta.py:131 msgid "Failed to get Python version." msgstr "获取 Python 版本失败." -#: nb_cli/handlers/meta.py:127 nb_cli/handlers/meta.py:190 -#: nb_cli/handlers/meta.py:249 +#: nb_cli/handlers/meta.py:123 nb_cli/handlers/meta.py:186 +#: nb_cli/handlers/meta.py:245 msgid "Exit code {code}" msgstr "退出码 {code}" -#: nb_cli/handlers/meta.py:154 +#: nb_cli/handlers/meta.py:150 msgid "Python {major}.{minor} is not supported." msgstr "Python {major}.{minor} 不受支持." -#: nb_cli/handlers/meta.py:189 nb_cli/handlers/meta.py:198 +#: nb_cli/handlers/meta.py:185 nb_cli/handlers/meta.py:194 msgid "Failed to get NoneBot version." msgstr "获取 NoneBot 版本失败." -#: nb_cli/handlers/meta.py:216 +#: nb_cli/handlers/meta.py:212 msgid "NoneBot is not installed." msgstr "NoneBot 未安装." -#: nb_cli/handlers/meta.py:248 nb_cli/handlers/meta.py:257 +#: nb_cli/handlers/meta.py:244 nb_cli/handlers/meta.py:253 msgid "Failed to get pip version." msgstr "获取 pip 版本失败." -#: nb_cli/handlers/meta.py:275 +#: nb_cli/handlers/meta.py:271 msgid "pip is not installed." msgstr "pip 未安装."