litloop 1.18.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- litloop/__init__.py +89 -0
- litloop/__main__.py +6 -0
- litloop/_source_hygiene.py +158 -0
- litloop/agents/__init__.py +13 -0
- litloop/agents/client.py +164 -0
- litloop/agents/runner.py +123 -0
- litloop/agents/system.py +54 -0
- litloop/agents/tools.py +142 -0
- litloop/app_server.py +8 -0
- litloop/browser/__init__.py +1 -0
- litloop/browser/backend.py +1009 -0
- litloop/browser/camofox_api.py +368 -0
- litloop/browser/chrome_copy.py +136 -0
- litloop/browser/cloakbrowser_compat.py +72 -0
- litloop/browser/cookies.py +347 -0
- litloop/browser/engine.py +965 -0
- litloop/browser/login.py +636 -0
- litloop/browser/pdf.py +263 -0
- litloop/browser/profile_health.py +167 -0
- litloop/browser/runtime.py +210 -0
- litloop/cache.py +104 -0
- litloop/citations/__init__.py +1 -0
- litloop/citations/bib_import.py +102 -0
- litloop/citations/bibtex_crossref.py +143 -0
- litloop/citations/formats.py +225 -0
- litloop/citations/paper_list.py +200 -0
- litloop/citations/session_export.py +94 -0
- litloop/cli/__init__.py +12 -0
- litloop/cli/_utils.py +267 -0
- litloop/cli/commands.py +1098 -0
- litloop/cli/doctor.py +141 -0
- litloop/cli/main.py +1173 -0
- litloop/cli/web.py +190 -0
- litloop/config.py +413 -0
- litloop/data/VARCON-LICENSE.txt +62 -0
- litloop/data/elements.tsv +119 -0
- litloop/data/institutional_identity_policy.json +165 -0
- litloop/data/publisher_access_catalog.json +969 -0
- litloop/data/publisher_carsi.json +105 -0
- litloop/data/spelling_search.tsv.gz +0 -0
- litloop/data/spelling_us.tsv.gz +0 -0
- litloop/data/webvpn.dat +0 -0
- litloop/data/webvpn.json +603 -0
- litloop/db.py +1922 -0
- litloop/deps.py +128 -0
- litloop/desktop/__init__.py +1 -0
- litloop/desktop/agent_runner.py +537 -0
- litloop/desktop/download_jobs.py +571 -0
- litloop/desktop/error_text.py +192 -0
- litloop/desktop/server.py +999 -0
- litloop/desktop/settings.py +552 -0
- litloop/desktop/translate.py +103 -0
- litloop/diagnostics.py +126 -0
- litloop/download/__init__.py +1 -0
- litloop/download/doi_check.py +44 -0
- litloop/download/fetcher.py +975 -0
- litloop/download/markdown.py +130 -0
- litloop/download/pdf.py +454 -0
- litloop/download/pipeline.py +1166 -0
- litloop/download/progress.py +312 -0
- litloop/download/rename.py +211 -0
- litloop/extractors/__init__.py +0 -0
- litloop/extractors/html_extractor.py +31 -0
- litloop/extractors/pdf_extractor.py +151 -0
- litloop/extractors/publisher_adapters/__init__.py +0 -0
- litloop/extractors/publisher_adapters/acs.py +167 -0
- litloop/extractors/publisher_adapters/elsevier.py +178 -0
- litloop/extractors/publisher_adapters/generic.py +191 -0
- litloop/extractors/publisher_adapters/nature.py +204 -0
- litloop/extractors/publisher_adapters/rsc.py +154 -0
- litloop/extractors/publisher_adapters/tandfonline.py +154 -0
- litloop/extractors/publisher_adapters/wiley.py +160 -0
- litloop/http_utils.py +57 -0
- litloop/identifiers.py +134 -0
- litloop/institutional/__init__.py +1 -0
- litloop/institutional/auth.py +576 -0
- litloop/institutional/carsi_login.py +569 -0
- litloop/institutional/config_adapter.py +63 -0
- litloop/institutional/proxy_check.py +98 -0
- litloop/institutional/remote_assist.py +274 -0
- litloop/institutional/schools.py +102 -0
- litloop/institutional/session_heal.py +73 -0
- litloop/institutional/session_store.py +105 -0
- litloop/log.py +47 -0
- litloop/models.py +269 -0
- litloop/network.py +417 -0
- litloop/optional.py +310 -0
- litloop/publishers/__init__.py +1 -0
- litloop/publishers/access.py +232 -0
- litloop/publishers/pdf_router.py +451 -0
- litloop/publishers/profiles.py +899 -0
- litloop/publishers/strategies/__init__.py +122 -0
- litloop/publishers/strategies/_core.py +2340 -0
- litloop/publishers/strategies/_elsevier_api.py +578 -0
- litloop/publishers/strategies/acm.py +27 -0
- litloop/publishers/strategies/acs.py +42 -0
- litloop/publishers/strategies/aip.py +27 -0
- litloop/publishers/strategies/aps.py +29 -0
- litloop/publishers/strategies/asce.py +28 -0
- litloop/publishers/strategies/base.py +108 -0
- litloop/publishers/strategies/copernicus.py +24 -0
- litloop/publishers/strategies/elsevier.py +66 -0
- litloop/publishers/strategies/generic.py +39 -0
- litloop/publishers/strategies/ieee.py +28 -0
- litloop/publishers/strategies/iop.py +27 -0
- litloop/publishers/strategies/nature.py +27 -0
- litloop/publishers/strategies/oxford.py +27 -0
- litloop/publishers/strategies/registry.py +83 -0
- litloop/publishers/strategies/royalsociety.py +28 -0
- litloop/publishers/strategies/rsc.py +27 -0
- litloop/publishers/strategies/sage.py +30 -0
- litloop/publishers/strategies/science.py +27 -0
- litloop/publishers/strategies/springer.py +34 -0
- litloop/publishers/strategies/tandfonline.py +32 -0
- litloop/publishers/strategies/wiley.py +32 -0
- litloop/publishers/supplementary.py +219 -0
- litloop/quota.py +202 -0
- litloop/search/__init__.py +1 -0
- litloop/search/abstracts.py +291 -0
- litloop/search/deep.py +1216 -0
- litloop/search/quick.py +1102 -0
- litloop/search/scansci_find.py +410 -0
- litloop/search/screening.py +225 -0
- litloop/search/title_to_doi.py +163 -0
- litloop/search/watches.py +124 -0
- litloop/server.py +1731 -0
- litloop/sources/__init__.py +1339 -0
- litloop/sources/_batch.py +529 -0
- litloop/sources/_index.py +221 -0
- litloop/sources/_routes.py +290 -0
- litloop/sources/altcha.py +90 -0
- litloop/sources/arxiv.py +45 -0
- litloop/sources/attempt.py +91 -0
- litloop/sources/carsi.py +74 -0
- litloop/sources/core_api.py +46 -0
- litloop/sources/crossref.py +162 -0
- litloop/sources/elsevier_api.py +620 -0
- litloop/sources/elsevier_check.py +274 -0
- litloop/sources/europepmc.py +81 -0
- litloop/sources/ezproxy.py +317 -0
- litloop/sources/instsci.py +1295 -0
- litloop/sources/libgen.py +116 -0
- litloop/sources/nature.py +39 -0
- litloop/sources/oa_discovery.py +135 -0
- litloop/sources/openaire.py +122 -0
- litloop/sources/openalex.py +100 -0
- litloop/sources/publishers.py +684 -0
- litloop/sources/sage_cn.py +139 -0
- litloop/sources/scibban.py +10 -0
- litloop/sources/scihub.py +1379 -0
- litloop/sources/scihub_domains.py +203 -0
- litloop/sources/scihub_speed.py +187 -0
- litloop/sources/scoring.py +250 -0
- litloop/sources/semantic_scholar.py +146 -0
- litloop/sources/springer_tdm.py +172 -0
- litloop/sources/unpaywall.py +116 -0
- litloop/sources/vpnsci.py +38 -0
- litloop/store.py +264 -0
- litloop/templates/index.html +347 -0
- litloop/terms/__init__.py +1 -0
- litloop/terms/glossary.py +422 -0
- litloop/terms/spelling.py +89 -0
- litloop/terms/text.py +106 -0
- litloop/tor/__init__.py +1 -0
- litloop/tor/embedded.py +371 -0
- litloop/tor/proxy.py +110 -0
- litloop/updates.py +148 -0
- litloop/zotero/__init__.py +1 -0
- litloop/zotero/bridge.py +309 -0
- litloop/zotero/client.py +317 -0
- litloop-1.18.3.dist-info/METADATA +347 -0
- litloop-1.18.3.dist-info/RECORD +176 -0
- litloop-1.18.3.dist-info/WHEEL +5 -0
- litloop-1.18.3.dist-info/entry_points.txt +2 -0
- litloop-1.18.3.dist-info/licenses/LICENSE +197 -0
- litloop-1.18.3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"""Raw errors (download engine, zotero-mcp, APIs) -> text the app shows.
|
|
2
|
+
|
|
3
|
+
The one place that turns raw error strings into the wording docs/UI_COPY.md
|
|
4
|
+
(section 7) asks for. Files keep the raw text for logs and debugging; the app
|
|
5
|
+
backend translates when it hands data to the app, and the app shows the raw
|
|
6
|
+
text only in a tooltip.
|
|
7
|
+
|
|
8
|
+
``reason(raw)`` gives the short reason for a status line ("学校未订阅此期刊…");
|
|
9
|
+
``message(raw, action)`` the full sentence "无法<action>:<reason>。<next step>".
|
|
10
|
+
Unknown errors fall back to a generic sentence, never to the raw text.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import re
|
|
16
|
+
|
|
17
|
+
# (pattern, reason, next step, optional action). Matched in order against the raw text,
|
|
18
|
+
# case-insensitively; the first hit wins. Keep the most specific first.
|
|
19
|
+
_ACT_SCHOOL = {"kind": "settings", "group": "school", "label": "去学校认证"}
|
|
20
|
+
_ACT_NETWORK = {"kind": "settings", "group": "network", "label": "检查网络设置"}
|
|
21
|
+
_ACT_SOURCES = {"kind": "settings", "group": "sources", "label": "去检索接口"}
|
|
22
|
+
_ACT_DOWNLOADS = {"kind": "settings", "group": "downloads", "label": "去下载设置"}
|
|
23
|
+
_ACT_COMPONENTS = {"kind": "settings", "group": "components", "label": "去可选组件"}
|
|
24
|
+
_ACT_ZOTERO_CFG = {"kind": "settings", "group": "zotero", "label": "去 Zotero 设置"}
|
|
25
|
+
_ACT_ZOTERO_CHECK = {"kind": "zotero", "view": "check", "label": "前往附件检查"}
|
|
26
|
+
_ACT_RETRY = {"kind": "retry", "label": "重试此篇"}
|
|
27
|
+
|
|
28
|
+
_RULES: list[tuple[str, str, str, dict[str, str] | None]] = [
|
|
29
|
+
(r"\bcancel", "已取消", "", None),
|
|
30
|
+
(r"DOI is not registered", "此 DOI 不存在", "检查 DOI 是否抄错", None),
|
|
31
|
+
(r"skipped by user", "已跳过", "可在任务结束后重试未完成项", _ACT_RETRY),
|
|
32
|
+
(r"the school does not subscribe", "学校没有订阅:已用学校身份登录出版商网站,仍没有全文",
|
|
33
|
+
"学校认证最终也到同一出版商,已跳过。可通过图书馆文献传递获取", None),
|
|
34
|
+
(r"NOT_ENTITLED", "学校未订阅此期刊,或当前不在校园网", "连接校园网或在「设置 → 学校认证」中登录后重试", _ACT_SCHOOL),
|
|
35
|
+
(r"No valid session|session (expired|invalid)|login required|需要机构登录",
|
|
36
|
+
"学校认证已过期或未登录", "在「设置 → 学校认证」中重新登录", _ACT_SCHOOL),
|
|
37
|
+
(r"Login failed or timed out", "登录超时", "确认已安装 Chrome 后重试", _ACT_COMPONENTS),
|
|
38
|
+
(r"WebVPN not configured|No WebVPN URL", "未设置 WebVPN", "在「设置 → 学校认证」中填写学校代号", _ACT_SCHOOL),
|
|
39
|
+
(r"zotero-mcp is too old", "zotero-mcp 版本过旧", "更新 zotero-mcp 后重试", _ACT_ZOTERO_CFG),
|
|
40
|
+
(r"zotero-mcp not (found|installed)|cannot start zotero-mcp", "未找到 zotero-mcp", "在「设置 → Zotero」中填写它的 Python 路径", _ACT_ZOTERO_CFG),
|
|
41
|
+
(r"\bdenied\b|not authori[sz]ed by the user", "Zotero 未允许本地写入", "重新授权,并在 Zotero 弹出的窗口中选择允许", _ACT_ZOTERO_CFG),
|
|
42
|
+
(r"bridge timed out|Zotero is not reachable|Connection refused.*23119|23119.*(refused|timed out)",
|
|
43
|
+
"Zotero 没有响应", "确认 Zotero 已启动后重试", _ACT_ZOTERO_CFG),
|
|
44
|
+
(r"no local PDF", "本机没有此文献的 PDF", "先下载此文献", None),
|
|
45
|
+
(r"cannot create the collection|empty collection path|Failed to create collection",
|
|
46
|
+
"无法创建分类", "检查分类路径后重试", None),
|
|
47
|
+
(r"holds no file|exists but holds no file", "Zotero 里的附件为空", "在「附件检查」中重新附加", _ACT_ZOTERO_CHECK),
|
|
48
|
+
(r"school login not completed", "学校认证的登录没有完成", "重试,并在弹出的窗口中完成登录", _ACT_RETRY),
|
|
49
|
+
(r"Cloudflare|anti-bot|human check", "网站要求人机验证,没有通过", "重试,并在弹出的窗口中完成验证", _ACT_RETRY),
|
|
50
|
+
(r"could not open the publisher page|site unreachable|\bERR_[A-Z_]+", "打不开出版商网页", "检查网络或代理后重试", _ACT_NETWORK),
|
|
51
|
+
(r"browser not available", "浏览器无法启动", "确认已安装 Chrome 后重试", _ACT_COMPONENTS),
|
|
52
|
+
(r"no PDF link", "出版商网页上没有 PDF 链接,可能没有权限", "连接校园网或在「设置 → 学校认证」中登录后重试", _ACT_SCHOOL),
|
|
53
|
+
(r"already being downloaded|\bin progress\b", "此文献正在另一个下载任务中下载", "等待那个任务完成", None),
|
|
54
|
+
(r"full_text_extracted_but_no_pdf", "只取得网页全文,没有 PDF", "", None),
|
|
55
|
+
(r"PDF file not found on disk", "下载后找不到 PDF 文件", "检查保存位置是否可写入", _ACT_DOWNLOADS),
|
|
56
|
+
(r"PDF not found after batch download", "所有来源都没有找到 PDF", "", None),
|
|
57
|
+
(r"arXiv PDF not available", "arXiv 上没有此文献的 PDF", "", None),
|
|
58
|
+
(r"no OA url|fast lane failed", "未找到开放获取版本", "", None),
|
|
59
|
+
(r"OpenAlex daily budget used up", "OpenAlex 今日积分已用完", "等待 UTC 零点重置,或在「设置 → 检索接口」中填写免费 Key", _ACT_SOURCES),
|
|
60
|
+
(r"OpenAlex request failed|OpenAlex HTTP \d+", "OpenAlex 暂时没有响应", "检查网络后重试", _ACT_NETWORK),
|
|
61
|
+
(r"\b429\b|rate.?limit|too many requests", "请求过于频繁,已被限流", "稍后重试", _ACT_RETRY),
|
|
62
|
+
(r"\b40[13]\b|forbidden|unauthori[sz]ed", "出版商拒绝访问,可能需要学校认证", "连接校园网或在「设置 → 学校认证」中登录后重试", _ACT_SCHOOL),
|
|
63
|
+
(r"\b404\b|not found", "出版商处找不到此文献", "", None),
|
|
64
|
+
(r"timed? ?out|timeout", "连接超时", "检查网络后重试", _ACT_NETWORK),
|
|
65
|
+
(r"Unpaywall.*email|email.*Unpaywall", "Unpaywall 需要你的真实邮箱", "在「设置 → 检索接口」中填写联系邮箱", _ACT_SOURCES),
|
|
66
|
+
(r"\bpaywall\b", "需要订阅才能下载", "连接校园网或在「设置 → 学校认证」中登录后重试", _ACT_SCHOOL),
|
|
67
|
+
(r"download exception|missing result|^invalid$", "下载过程出错", "详情已写入日志,可重试", _ACT_RETRY),
|
|
68
|
+
(r"^no result$|all sources failed|no source|no PDF found", "所有来源都没有找到 PDF", "", None),
|
|
69
|
+
(r"unrecognized identifier|invalid DOI", "无法识别的 DOI", "检查 DOI 是否完整", None),
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
_COMPILED = [(re.compile(p, re.I), r, n, a) for p, r, n, a in _RULES]
|
|
73
|
+
_EXCEPTION = re.compile(r"^[A-Z][A-Za-z]+(Error|Exception)\b")
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _match(raw: str) -> tuple[str, str, dict[str, str] | None] | None:
|
|
77
|
+
for rx, reason_text, step, action in _COMPILED:
|
|
78
|
+
if rx.search(raw):
|
|
79
|
+
return reason_text, step, action
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
# Which failure explains a paper best, when several ways failed (most telling first).
|
|
84
|
+
_FAILURE_ORDER = ("not_entitled", "login_abandoned", "cloudflare_blocked", "navigate_failed",
|
|
85
|
+
"timeout", "paywall", "no_pdf_found", "browser_unavailable", "not_found")
|
|
86
|
+
|
|
87
|
+
# A browser strategy reports (error_type, action) instead of a sentence; this is
|
|
88
|
+
# the raw text a failed step records for it, worded so a rule above matches.
|
|
89
|
+
_RAW_BY_TYPE = {
|
|
90
|
+
"not_entitled": "NOT_ENTITLED",
|
|
91
|
+
"login_abandoned": "school login not completed",
|
|
92
|
+
"cloudflare_blocked": "Cloudflare anti-bot protection blocked access",
|
|
93
|
+
"navigate_failed": "could not open the publisher page",
|
|
94
|
+
"paywall": "paywall — requires institutional access",
|
|
95
|
+
"no_pdf_found": "no PDF link on the publisher page",
|
|
96
|
+
"browser_unavailable": "browser not available",
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def raw_for(error_type: str, action: str = "") -> str:
|
|
101
|
+
"""Raw reason for a browser strategy's (error_type, action)."""
|
|
102
|
+
if error_type == "not_entitled" and action == "no_subscription":
|
|
103
|
+
return "the school does not subscribe: logged into the publisher with the school's identity, still no full text"
|
|
104
|
+
return _RAW_BY_TYPE.get(error_type, error_type)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def pick_failure(result: dict | None) -> str | None:
|
|
108
|
+
"""The raw reason to show for a failed download: the result's own reason when it
|
|
109
|
+
is a known one (skipped, cancelled, not subscribed...), else the most telling of
|
|
110
|
+
the ways it tried (``result["attempts"]``)."""
|
|
111
|
+
if not result or result.get("success"):
|
|
112
|
+
return None
|
|
113
|
+
own = result.get("error") or result.get("reason")
|
|
114
|
+
hit = _match(str(own)) if own else None
|
|
115
|
+
failed = [s for s in result.get("attempts") or [] if not s.get("ok") and s.get("reason")]
|
|
116
|
+
if own and result.get("error_type") in ("skipped", "cancelled"):
|
|
117
|
+
return str(own)
|
|
118
|
+
# The result's own reason, unless one of the ways tried explains it better
|
|
119
|
+
# ("All sources failed" never does; a lane's paywall loses to the school's
|
|
120
|
+
# "not subscribed" whichever came last).
|
|
121
|
+
rank = {t: i for i, t in enumerate(_FAILURE_ORDER)}
|
|
122
|
+
own_rank = rank.get(str(result.get("error_type") or ""), len(rank))
|
|
123
|
+
better = [s for s in failed if rank.get(str(s.get("error_type") or ""), len(rank)) < own_rank]
|
|
124
|
+
if own and hit is not None and hit[0] != "所有来源都没有找到 PDF" and not better:
|
|
125
|
+
return str(own)
|
|
126
|
+
for kind in _FAILURE_ORDER:
|
|
127
|
+
for s in failed:
|
|
128
|
+
if s.get("error_type") == kind:
|
|
129
|
+
return str(s["reason"])
|
|
130
|
+
for s in failed:
|
|
131
|
+
if _match(str(s["reason"])) is not None:
|
|
132
|
+
return str(s["reason"])
|
|
133
|
+
return str(own) if own else None
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def steps_for_app(attempts: list | None) -> list[dict] | None:
|
|
137
|
+
"""The ways a paper was tried, for the app's download page: the ones that
|
|
138
|
+
took time or opened a site (quick API misses are left out), with the reason
|
|
139
|
+
in plain words."""
|
|
140
|
+
out = []
|
|
141
|
+
for s in attempts or []:
|
|
142
|
+
src = str(s.get("source") or "")
|
|
143
|
+
if s.get("ok") or s.get("route") == "school" or "Browser" in src or float(s.get("seconds") or 0) >= 1:
|
|
144
|
+
out.append({"source": src, "route": s.get("route"), "seconds": s.get("seconds"), "ok": bool(s.get("ok")),
|
|
145
|
+
"why": None if s.get("ok") else reason(s.get("reason")) if s.get("reason") else None})
|
|
146
|
+
return out or None
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def reason(raw: str | None) -> str | None:
|
|
150
|
+
"""Short reason for a status line, e.g. '学校未订阅此期刊,或当前不在校园网'."""
|
|
151
|
+
if not raw:
|
|
152
|
+
return None
|
|
153
|
+
hit = _match(str(raw))
|
|
154
|
+
return hit[0] if hit else "出现意外错误" # docs/UI_COPY.md 7: the raw text goes in the tooltip
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def next_step(raw: str | None) -> str | None:
|
|
158
|
+
"""Actionable hint text for a known error, without repeating the reason."""
|
|
159
|
+
if not raw:
|
|
160
|
+
return None
|
|
161
|
+
hit = _match(str(raw))
|
|
162
|
+
if not hit or not hit[1]:
|
|
163
|
+
return None
|
|
164
|
+
return hit[1]
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def action_for(raw: str | None) -> dict[str, str] | None:
|
|
168
|
+
"""Structured UI navigation/retry action for a known error, or None."""
|
|
169
|
+
if not raw:
|
|
170
|
+
return None
|
|
171
|
+
hit = _match(str(raw))
|
|
172
|
+
if not hit or hit[2] is None:
|
|
173
|
+
return None
|
|
174
|
+
return dict(hit[2])
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def message(raw: str | None, action: str) -> str | None:
|
|
178
|
+
"""Full sentence: '无法<action>:<reason>。<next step>。' (or the generic one)."""
|
|
179
|
+
if not raw:
|
|
180
|
+
return None
|
|
181
|
+
raw = str(raw)
|
|
182
|
+
hit = _match(raw)
|
|
183
|
+
if hit is None:
|
|
184
|
+
if _EXCEPTION.match(raw):
|
|
185
|
+
return f"抱歉,{action}时出现意外错误。详情已写入日志。"
|
|
186
|
+
return f"无法{action}:出现意外错误"
|
|
187
|
+
reason_text, step, _ = hit
|
|
188
|
+
if reason_text == "已取消":
|
|
189
|
+
return "已取消"
|
|
190
|
+
if step:
|
|
191
|
+
return f"无法{action}:{reason_text}。{step}。"
|
|
192
|
+
return f"无法{action}:{reason_text}。"
|