Skip to content

Commit

Permalink
🐛 version 0.11.1
Browse files Browse the repository at this point in the history
fix unload_plugin
  • Loading branch information
RF-Tar-Railt committed Dec 30, 2024
1 parent 50b6e29 commit 09f7dc4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion arclet/entari/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@
WH = WebhookInfo
filter_ = Filter

__version__ = "0.10.5"
__version__ = "0.11.1"
19 changes: 9 additions & 10 deletions arclet/entari/plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,6 @@ def load_plugins(dir_: str | PathLike | Path):
load_plugin(".".join(p.parts[:-1:1]) + "." + p.stem)


def unload_plugin(plugin: str):
while plugin in plugin_service._subplugined:
plugin = plugin_service._subplugined[plugin]
if plugin not in plugin_service.plugins:
return False
_plugin = plugin_service.plugins[plugin]
_plugin.dispose()
return True


@init_spec(PluginMetadata)
def metadata(data: PluginMetadata):
if not (plugin := _current_plugin.get(None)):
Expand Down Expand Up @@ -180,4 +170,13 @@ def find_plugin_by_file(file: str) -> Plugin | None:
return None


def unload_plugin(plugin: str):
while plugin in plugin_service._subplugined:
plugin = plugin_service._subplugined[plugin]
if not (_plugin := find_plugin(plugin)):
return False
_plugin.dispose()
return True


listen = es.on
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.11.0"
version = "0.11.1"
description = "Simple IM Framework based on satori-python"
authors = [
{name = "RF-Tar-Railt",email = "[email protected]"},
Expand Down

0 comments on commit 09f7dc4

Please sign in to comment.