Skip to content

Commit b7decee

Browse files
committed
🐛 version 0.10.1
fix local_data & plugin referent
1 parent 2696700 commit b7decee

5 files changed

Lines changed: 6 additions & 4 deletions

File tree

arclet/entari/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@
6464
WH = WebhookInfo
6565
filter_ = Filter
6666

67-
__version__ = "0.10.0"
67+
__version__ = "0.10.1"

arclet/entari/plugin/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def declare_static():
128128
if not (plugin := _current_plugin.get(None)):
129129
raise LookupError("no plugin context found")
130130
plugin.is_static = True
131+
if plugin.dispatchers:
132+
raise StaticPluginDispatchError("static plugin cannot dispatch events")
131133

132134

133135
def find_plugin(name: str) -> Plugin | None:

arclet/entari/plugin/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def source_to_code(self, data, path, *, _optimize=-1): # type: ignore
117117
"""
118118
is_init = Path(path).name == "__init__.py"
119119
name = self.name
120-
if not is_init and self.name.count("."):
120+
if is_init and self.name.count("."):
121121
name = self.name.rpartition(".")[0]
122122
try:
123123
nodes = ast.parse(data, type_comments=True)

arclet/entari/utils/local_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def __init__(self):
151151
self.root: Optional[Path] = None
152152
self.app_name = "Entari"
153153
self._temp_dir = TemporaryDirectory()
154-
finalize(local_data, lambda obj: obj._temp_dir.cleanup(), self)
154+
finalize(self, lambda obj: obj._temp_dir.cleanup(), self)
155155

156156
def _get_base_cache_dir(self) -> Path:
157157
return user_cache_dir(self.app_name).resolve() if self.root is None else self.root

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "arclet-entari"
3-
version = "0.10.0"
3+
version = "0.10.1"
44
description = "Simple IM Framework based on satori-python"
55
authors = [
66
{name = "RF-Tar-Railt",email = "rf_tar_railt@qq.com"},

0 commit comments

Comments
 (0)