chore(src/utils): drop unused dbus_helper and monitors modules and cleanup utils code

This commit is contained in:
sankalp committed 2026-07-04 07:27:02 +05:45
1 parent 01c193bd8e
commit a2cda4c3e6
4 files changed
+2 -213

No files matched your search

-27
View File
@@ -1,36 +1,9 @@
import asyncio
import functools
import typing as t
from fabric.utils import GLib
def debounce(delay: float) -> t.Callable[..., t.Any]:
def decorator(func: t.Callable[..., t.Any]) -> t.Callable[..., t.Any]:
task: asyncio.Task[None] | None = None
@functools.wraps(func)
async def wrapper(*args: t.Any, **kwargs: t.Any) -> None:
nonlocal task
if task is not None and not task.done():
task.cancel()
try:
await task
except asyncio.CancelledError:
pass
async def delayed_call() -> None:
await asyncio.sleep(delay)
await func(*args, **kwargs)
task = asyncio.create_task(delayed_call())
return wrapper
return decorator
def sync_debounce(
delay: int, min_n_times: int = 0, immediate: bool = False
) -> t.Callable[..., t.Any]: