From b87e4f5a61ae8fa015cab38de2614302148234af Mon Sep 17 00:00:00 2001 From: fdev31 Date: Thu, 4 Jul 2024 22:00:31 +0200 Subject: [PATCH] fix previous commit --- pyprland/command.py | 9 +++++---- pyprland/version.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pyprland/command.py b/pyprland/command.py index 5faf1f3..a9563ba 100644 --- a/pyprland/command.py +++ b/pyprland/command.py @@ -38,14 +38,15 @@ def remove_duplicate(names: list[str]) -> Callable: def _remove_duplicates(fn: Callable) -> Callable: """Wrapper for the decorator.""" - async def _wrapper(self: Self, full_name: str, *params: str, notify: str = "") -> bool: + async def _wrapper(self: Self, full_name: str, *args, **kwargs) -> bool: """Wrapper for the function.""" if full_name in names: - key = (full_name, params) + key = (full_name, args) + print(key) if key == _dedup_last_call.get(full_name): return True _dedup_last_call[full_name] = key - return await fn(self, full_name, *params, notify) + return await fn(self, full_name, *args, **kwargs) return _wrapper @@ -213,7 +214,7 @@ async def _run_plugin_handler(self, plugin: Plugin, full_name: str, params: tupl self.log.exception("%s::%s(%s) failed:", plugin.name, full_name, params) await notify_error(f"Pypr error {plugin.name}::{full_name}: {e}") - @remove_duplicate(names=["active_window"]) + @remove_duplicate(names=["active_window", "active_windowv2"]) async def _call_handler(self, full_name: str, *params: str, notify: str = "") -> bool: """Call an event handler with params.""" handled = False diff --git a/pyprland/version.py b/pyprland/version.py index 08ee081..eb33ca3 100644 --- a/pyprland/version.py +++ b/pyprland/version.py @@ -1,3 +1,3 @@ """Package version.""" -VERSION = "2.4.0-6" +VERSION = "2.4.0-7"