Using group name

This commit is contained in:
Aoran Zeng 2025-07-14 14:53:14 +08:00
parent f9b3362dbd
commit a71a39230b
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
8 changed files with 22 additions and 22 deletions

View File

@ -28,7 +28,7 @@ pl_python_pdm_getsrc (char *option)
void void
pl_python_pdm_setsrc (char *option) pl_python_pdm_setsrc (char *option)
{ {
chsrc_yield_source (pl_python); chsrc_yield_source (pl_python_group);
if (chsrc_in_standalone_mode()) if (chsrc_in_standalone_mode())
chsrc_confirm_source; chsrc_confirm_source;
@ -82,4 +82,4 @@ pl_python_pdm_feat (char *option)
} }
// def_target_gsrf(pl_python_pdm); // def_target_gsrf(pl_python_pdm);
Target_t pl_python_pdm_target = {def_target_inner_gsrf(pl_python_pdm),def_target_sourcesn(pl_python)}; Target_t pl_python_pdm_target = {def_target_inner_gsrf(pl_python_pdm),def_target_sourcesn(pl_python_group)};

View File

@ -27,7 +27,7 @@ pl_python_poetry_getsrc (char *option)
void void
pl_python_poetry_setsrc (char *option) pl_python_poetry_setsrc (char *option)
{ {
chsrc_yield_source (pl_python); chsrc_yield_source (pl_python_group);
if (chsrc_in_standalone_mode()) if (chsrc_in_standalone_mode())
chsrc_confirm_source; chsrc_confirm_source;
@ -78,4 +78,4 @@ pl_python_poetry_feat (char *option)
} }
// def_target_gsrf(pl_python_poetry); // def_target_gsrf(pl_python_poetry);
Target_t pl_python_poetry_target = {def_target_inner_gsrf(pl_python_poetry),def_target_sourcesn(pl_python)}; Target_t pl_python_poetry_target = {def_target_inner_gsrf(pl_python_poetry),def_target_sourcesn(pl_python_group)};

View File

@ -5,12 +5,12 @@
* Contributors : happy game <happygame1024@gmail.com> * Contributors : happy game <happygame1024@gmail.com>
* | * |
* Created On : <2023-09-03> * Created On : <2023-09-03>
* Last Modified : <2024-12-11> * Last Modified : <2025-07-14>
* *
* ------------------------------------------------------------*/ * ------------------------------------------------------------*/
void void
pl_python_getsrc (char *option) pl_python_group_getsrc (char *option)
{ {
bool pdm_exist = false, bool pdm_exist = false,
poetry_exist = false, poetry_exist = false,
@ -41,7 +41,7 @@ pl_python_getsrc (char *option)
void void
pl_python_setsrc (char *option) pl_python_group_setsrc (char *option)
{ {
{ {
char *msg = ENGLISH ? "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: "
@ -58,7 +58,7 @@ pl_python_setsrc (char *option)
pl_python_check_unofficial_pkger (&poetry_exist, &pdm_exist, &uv_exist); pl_python_check_unofficial_pkger (&poetry_exist, &pdm_exist, &uv_exist);
chsrc_set_target_group_mode (); chsrc_set_target_group_mode ();
chsrc_yield_source_and_confirm (pl_python); chsrc_yield_source_and_confirm (pl_python_group);
// 交给后面检查命令的存在性 // 交给后面检查命令的存在性
@ -86,14 +86,14 @@ pl_python_setsrc (char *option)
} }
void void
pl_python_resetsrc (char *option) pl_python_group_resetsrc (char *option)
{ {
pl_python_setsrc (option); pl_python_group_setsrc (option);
} }
Feature_t Feature_t
pl_python_feat (char *option) pl_python_group_feat (char *option)
{ {
Feature_t f = {0}; Feature_t f = {0};
@ -101,11 +101,11 @@ pl_python_feat (char *option)
f.can_reset = true; f.can_reset = true;
f.cap_locally = PartiallyCan; f.cap_locally = PartiallyCan;
f.cap_locally_explain = "Support `Poetry` & `PDM`, `uv`. No support for `pip`"; f.cap_locally_explain = "Support Poetry, PDM, uv. No support for pip";
f.can_english = false; f.can_english = false;
f.can_user_define = true; f.can_user_define = true;
return f; return f;
} }
def_target_gsrf(pl_python); def_target_gsrf(pl_python_group);

View File

@ -39,7 +39,7 @@ void
pl_python_rye_setsrc (char *option) pl_python_rye_setsrc (char *option)
{ {
/* 并不在 Python group 中,所以不考虑 target group 情况 */ /* 并不在 Python group 中,所以不考虑 target group 情况 */
chsrc_yield_source_and_confirm (pl_python); chsrc_yield_source_and_confirm (pl_python_group);
const char *file = xy_strjoin (7, const char *file = xy_strjoin (7,
"[[sources]]\n", "[[sources]]\n",
@ -87,4 +87,4 @@ pl_python_rye_feat (char *option)
} }
// def_target_gsrf(pl_python_rye); // def_target_gsrf(pl_python_rye);
Target_t pl_python_rye_target = {def_target_inner_gsrf(pl_python_rye),def_target_sourcesn(pl_python)}; Target_t pl_python_rye_target = {def_target_inner_gsrf(pl_python_rye),def_target_sourcesn(pl_python_group)};

View File

@ -26,7 +26,7 @@ static SourceProvider_t pl_python_pypi_upstream =
* @update 2025-07-11 * @update 2025-07-11
* @note ZjuPyPI服务在校外访问会自动转向Tuna * @note ZjuPyPI服务在校外访问会自动转向Tuna
*/ */
static Source_t pl_python_sources[] = static Source_t pl_python_group_sources[] =
{ {
{&pl_python_pypi_upstream, "https://pypi.org/simple", DelegateToUpstream}, {&pl_python_pypi_upstream, "https://pypi.org/simple", DelegateToUpstream},
@ -72,7 +72,7 @@ static Source_t pl_python_sources[] =
/* 不启用原因24小时更新一次 */ /* 不启用原因24小时更新一次 */
// {&Netease, "https://mirrors.163.com/.help/pypi.html", NULL} // {&Netease, "https://mirrors.163.com/.help/pypi.html", NULL}
}; };
def_sources_n(pl_python); def_sources_n(pl_python_group);
void void
pl_python_check_unofficial_pkger (bool *poetry_exist, bool *pdm_exist, bool *uv_exist) pl_python_check_unofficial_pkger (bool *poetry_exist, bool *pdm_exist, bool *uv_exist)

View File

@ -38,7 +38,7 @@ pl_python_pip_setsrc (char *option)
return; return;
} }
chsrc_yield_source (pl_python); chsrc_yield_source (pl_python_group);
if (chsrc_in_standalone_mode()) if (chsrc_in_standalone_mode())
chsrc_confirm_source; chsrc_confirm_source;
@ -91,4 +91,4 @@ pl_python_pip_feat (char *option)
} }
// def_target_gsrf(pl_python_pip); // def_target_gsrf(pl_python_pip);
Target_t pl_python_pip_target = {def_target_inner_gsrf(pl_python_pip),def_target_sourcesn(pl_python)}; Target_t pl_python_pip_target = {def_target_inner_gsrf(pl_python_pip),def_target_sourcesn(pl_python_group)};

View File

@ -96,7 +96,7 @@ pl_python_uv_setsrc (char *option)
{ {
chsrc_ensure_program ("uv"); chsrc_ensure_program ("uv");
chsrc_yield_source (pl_python); chsrc_yield_source (pl_python_group);
if (chsrc_in_standalone_mode()) if (chsrc_in_standalone_mode())
chsrc_confirm_source; chsrc_confirm_source;
@ -210,4 +210,4 @@ pl_python_uv_feat (char *option)
} }
// def_target_gsrf(pl_python_uv); // def_target_gsrf(pl_python_uv);
Target_t pl_python_uv_target = {def_target_inner_gsrf(pl_python_uv),def_target_sourcesn(pl_python)}; Target_t pl_python_uv_target = {def_target_inner_gsrf(pl_python_uv),def_target_sourcesn(pl_python_group)};

View File

@ -14,7 +14,7 @@
static const char static const char
*pl_ruby [] = {"gem", "ruby", "rb", "rubygem", "rubygems", "bundler", NULL, t(&pl_ruby_target)}, *pl_ruby [] = {"gem", "ruby", "rb", "rubygem", "rubygems", "bundler", NULL, t(&pl_ruby_target)},
*pl_python[] = {"python", "pypi", "py", NULL, t(&pl_python_target)}, *pl_python[] = {"python", "pypi", "py", NULL, t(&pl_python_group_target)},
*pl_python_pip[] = {"pip", NULL, t(&pl_python_pip_target)}, *pl_python_pip[] = {"pip", NULL, t(&pl_python_pip_target)},
*pl_python_poetry[] = {"poetry", NULL, t(&pl_python_poetry_target)}, *pl_python_poetry[] = {"poetry", NULL, t(&pl_python_poetry_target)},
*pl_python_pdm[] = {"pdm", NULL, t(&pl_python_pdm_target)}, *pl_python_pdm[] = {"pdm", NULL, t(&pl_python_pdm_target)},