Use new ProgMode

This commit is contained in:
Aoran Zeng
2025-07-11 11:24:29 +08:00
parent 5f8da597ff
commit 4b5aff7862
18 changed files with 158 additions and 156 deletions

View File

@@ -35,7 +35,7 @@ pl_python_pdm_setsrc (char *option)
char *cmd = NULL;
if (CliOpt_Locally==true)
if (chsrc_in_local_mode())
cmd = xy_2strjoin ("pdm config --local pypi.url ", source.url);
else
cmd = xy_2strjoin ("pdm config --global pypi.url ", source.url);

View File

@@ -34,7 +34,7 @@ pl_python_poetry_setsrc (char *option)
char *cmd = NULL;
if (CliOpt_Locally==false)
if (!chsrc_in_local_mode())
chsrc_note2 ("Poertry 仅支持项目级换源");
cmd = xy_2strjoin ("poetry source add my_mirror ", source.url);

View File

@@ -44,7 +44,7 @@ void
pl_python_setsrc (char *option)
{
{
char *msg = CliOpt_InEnglish ? "Three package managers will be replaced for you at the same time: " \
char *msg = ENGLISH ? "Three package managers will be replaced for you at the same time: " \
"pip, Poetry, PDM. If you need to change the source independently, " \
"please run independently `chsrc set <pkg-manager>`"
: "将同时为您更换4个包管理器 pip, Poetry, PDM, uv 的源,若需要独立换源,请独立运行 chsrc set <pkg-manager>";

View File

@@ -30,9 +30,9 @@ void
pl_python_pip_setsrc (char *option)
{
// 对于不支持的情况,尽早结束
if (CliOpt_Locally)
if (chsrc_in_local_mode())
{
char *msg = CliOpt_InEnglish ? "pip doesn't support `-local`. SKIP changing source!" : "pip 不支持 -local跳过换源";
char *msg = ENGLISH ? "pip doesn't support `-local`. SKIP changing source!" : "pip 不支持 -local跳过换源";
chsrc_error (msg);
// 不能直接退出,因为 Leader target 不能就此结束
return;

View File

@@ -27,7 +27,7 @@
char *
pl_python_find_uv_config (bool mkdir)
{
if (CliOpt_Locally)
if (chsrc_in_local_mode())
{
return xy_2strjoin (UV_LOCAL_CONFIG_PATH, UV_CONFIG);
}