Skip to content

Commit

Permalink
🔥 remove unnecessary target fetcher of Mail adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Dec 8, 2024
1 parent 24c00dd commit 4a38681
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 73 deletions.
98 changes: 49 additions & 49 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/nonebot_plugin_alconna/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def load_from_path(path: str) -> None:
attrs = filter(None, (match.group("attr") or "__extension__").split("."))
ext = functools.reduce(getattr, attrs, module)
if isinstance(ext, type) and issubclass(ext, Extension):
add_global_extension(ext)
add_global_extension(ext) # type: ignore
elif isinstance(ext, Extension):
add_global_extension(ext)
else:
Expand Down
21 changes: 0 additions & 21 deletions src/nonebot_plugin_alconna/uniseg/adapters/mail/target.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/nonebot_plugin_alconna/uniseg/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ def replace(
result_list: list[TS] = []
for seg in self:
if isinstance(seg, Text):
result_list.append(seg.replace(old, new))
result_list.append(seg.replace(old, new)) # type: ignore
else:
result_list.append(seg)
return self.__class__(result_list)
Expand Down
2 changes: 1 addition & 1 deletion src/nonebot_plugin_alconna/uniseg/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def split(self, pattern: Optional[str] = None):
result.append(Text(part, _styles))
return result

def replace(self, old: str, new: Union[str, "Text"]):
def replace(self, old: str, new: Union[str, "Text"]) -> "Text":
text = self.text
index = 0
new_text = new if isinstance(new, str) else new.text
Expand Down

0 comments on commit 4a38681

Please sign in to comment.