Skip to content

Commit 09f7dc4

Browse files
committed
🐛 version 0.11.1
fix unload_plugin
1 parent 50b6e29 commit 09f7dc4

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

arclet/entari/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@
6767
WH = WebhookInfo
6868
filter_ = Filter
6969

70-
__version__ = "0.10.5"
70+
__version__ = "0.11.1"

arclet/entari/plugin/__init__.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,6 @@ def load_plugins(dir_: str | PathLike | Path):
100100
load_plugin(".".join(p.parts[:-1:1]) + "." + p.stem)
101101

102102

103-
def unload_plugin(plugin: str):
104-
while plugin in plugin_service._subplugined:
105-
plugin = plugin_service._subplugined[plugin]
106-
if plugin not in plugin_service.plugins:
107-
return False
108-
_plugin = plugin_service.plugins[plugin]
109-
_plugin.dispose()
110-
return True
111-
112-
113103
@init_spec(PluginMetadata)
114104
def metadata(data: PluginMetadata):
115105
if not (plugin := _current_plugin.get(None)):
@@ -180,4 +170,13 @@ def find_plugin_by_file(file: str) -> Plugin | None:
180170
return None
181171

182172

173+
def unload_plugin(plugin: str):
174+
while plugin in plugin_service._subplugined:
175+
plugin = plugin_service._subplugined[plugin]
176+
if not (_plugin := find_plugin(plugin)):
177+
return False
178+
_plugin.dispose()
179+
return True
180+
181+
183182
listen = es.on

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "arclet-entari"
3-
version = "0.11.0"
3+
version = "0.11.1"
44
description = "Simple IM Framework based on satori-python"
55
authors = [
66
{name = "RF-Tar-Railt",email = "[email protected]"},

0 commit comments

Comments
 (0)