Skip to content

Commit 70e1dbb

Browse files
committed
🔖 version 1.8.38
1 parent b7445aa commit 70e1dbb

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# 更新日志
22

3+
## 1.8.38
4+
5+
### 修复
6+
7+
- 修复 `command_manager.get_commands` 无法使用 `Namespace` 对象
8+
- 修复 `ShortcutArgs` 的导出问题
9+
310
## 1.8.37
411

512
### 修复

src/arclet/alconna/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
from .typing import Up as Up
5555
from .typing import StrMulti as StrMulti
5656

57-
__version__ = "1.8.37"
57+
__version__ = "1.8.38"
5858

5959
# backward compatibility
6060
AnyOne = ANY

src/arclet/alconna/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Alconna(Subcommand, Generic[TDC]):
113113
behaviors: list[ArparmaBehavior]
114114
"""命令行为器"""
115115

116-
def compile(self, compiler: TCompile | None = None, param_ids: set[str] | None = None) -> Analyser[TDC]:
116+
def compile(self, compiler: TCompile | None = None, param_ids: set[str] | None = None):
117117
"""编译 `Alconna` 为对应的解析器"""
118118
return Analyser(self, compiler).compile(set() if param_ids is None else param_ids)
119119

src/arclet/alconna/manager.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,12 @@ def delete_shortcut(self, target: Alconna, key: str | TPattern | None = None):
366366
_key = key if isinstance(key, str) else key.pattern
367367
if _key in _shortcut[0]:
368368
args = _shortcut[0].pop(_key)
369-
if isinstance(args, InnerShortcutArgs) and args.prefixes:
370-
for prefix in args.prefixes:
371-
_shortcut[1].pop(f"{re.escape(prefix)}{args.origin_key}")
372-
else:
373-
_shortcut[1].pop(args.origin_key, None)
369+
if isinstance(args, InnerShortcutArgs):
370+
if args.prefixes:
371+
for prefix in args.prefixes:
372+
_shortcut[1].pop(f"{re.escape(prefix)}{args.origin_key}")
373+
else:
374+
_shortcut[1].pop(args.origin_key, None)
374375
return lang.require("shortcut", "delete_success").format(shortcut=f"[*]{args.origin_key}", target=target.path)
375376
for key, args in _shortcut[1].items():
376377
if re.fullmatch(key, _key, getattr(args, "flags", 0)):

0 commit comments

Comments
 (0)