Skip to content

Commit

Permalink
🐛 version 0.10.1
Browse files Browse the repository at this point in the history
fix local_data & plugin referent
  • Loading branch information
RF-Tar-Railt committed Dec 16, 2024
1 parent 2696700 commit b7decee
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arclet/entari/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@
WH = WebhookInfo
filter_ = Filter

__version__ = "0.10.0"
__version__ = "0.10.1"
2 changes: 2 additions & 0 deletions arclet/entari/plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def declare_static():
if not (plugin := _current_plugin.get(None)):
raise LookupError("no plugin context found")
plugin.is_static = True
if plugin.dispatchers:
raise StaticPluginDispatchError("static plugin cannot dispatch events")


def find_plugin(name: str) -> Plugin | None:
Expand Down
2 changes: 1 addition & 1 deletion arclet/entari/plugin/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def source_to_code(self, data, path, *, _optimize=-1): # type: ignore
"""
is_init = Path(path).name == "__init__.py"
name = self.name
if not is_init and self.name.count("."):
if is_init and self.name.count("."):
name = self.name.rpartition(".")[0]
try:
nodes = ast.parse(data, type_comments=True)
Expand Down
2 changes: 1 addition & 1 deletion arclet/entari/utils/local_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def __init__(self):
self.root: Optional[Path] = None
self.app_name = "Entari"
self._temp_dir = TemporaryDirectory()
finalize(local_data, lambda obj: obj._temp_dir.cleanup(), self)
finalize(self, lambda obj: obj._temp_dir.cleanup(), self)

def _get_base_cache_dir(self) -> Path:
return user_cache_dir(self.app_name).resolve() if self.root is None else self.root
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "arclet-entari"
version = "0.10.0"
version = "0.10.1"
description = "Simple IM Framework based on satori-python"
authors = [
{name = "RF-Tar-Railt",email = "[email protected]"},
Expand Down

0 comments on commit b7decee

Please sign in to comment.