Skip to content

Commit

Permalink
🐛 version 0.12.1
Browse files Browse the repository at this point in the history
fix command.assign
  • Loading branch information
RF-Tar-Railt committed Jan 29, 2025
1 parent 7b18d19 commit bcb33eb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 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 @@
WS = WebsocketsInfo
WH = WebhookInfo

__version__ = "0.12.0"
__version__ = "0.12.1"
13 changes: 8 additions & 5 deletions arclet/entari/command/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ def assign(
providers: list[Provider | type[Provider] | ProviderFactory | type[ProviderFactory]] | None = None,
):
assign = Assign(path, value, or_not)
try:
self.propagators.append(assign)
return self.register(priority=priority, providers=providers)
finally:
self.propagators.remove(assign)
wrapper = self.register(priority=priority, providers=providers)

def decorator(func):
sub = wrapper(func)
sub.propagate(assign)
return sub

return decorator

def on_execute(
self,
Expand Down
1 change: 1 addition & 0 deletions arclet/entari/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
class BasicConfig(TypedDict, total=False):
network: list[dict[str, Any]]
ignore_self_message: bool
skip_req_missing: bool
log_level: int | str
prefix: list[str]
cmd_count: int
Expand Down
4 changes: 4 additions & 0 deletions arclet/entari/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def from_config(cls, config: EntariConfig | None = None):
config = EntariConfig.instance
ignore_self_message = config.basic.get("ignore_self_message", True)
log_level = config.basic.get("log_level", "INFO")
skip_req_missing = config.basic.get("skip_req_missing", False)
configs = []
for conf in config.basic.get("network", []):
if conf["type"] in ("websocket", "websockets", "ws"):
Expand All @@ -117,16 +118,19 @@ def from_config(cls, config: EntariConfig | None = None):
*configs,
log_level=log_level,
ignore_self_message=ignore_self_message,
skip_req_missing=skip_req_missing,
)

def __init__(
self,
*configs: Config,
log_level: str | int = "INFO",
ignore_self_message: bool = True,
skip_req_missing: bool = False,
):
from . import __version__

es.global_skip_req_missing = skip_req_missing
log.core.info(f"Entari <b><c>version {__version__}</c></b>")
super().__init__(*configs, default_api_cls=EntariProtocol)
if not hasattr(EntariConfig, "instance"):
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.12.0"
version = "0.12.1"
description = "Simple IM Framework based on satori-python"
authors = [
{name = "RF-Tar-Railt",email = "rf_tar_railt@qq.com"},
Expand Down

0 comments on commit bcb33eb

Please sign in to comment.