Skip to content

Commit

Permalink
fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fdev31 committed Jul 4, 2024
1 parent 294f842 commit b87e4f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions pyprland/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyprland/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Package version."""

VERSION = "2.4.0-6"
VERSION = "2.4.0-7"

0 comments on commit b87e4f5

Please sign in to comment.