Skip to content

Commit

Permalink
stronger type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jan 14, 2025
1 parent 42d7116 commit 73ab86e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xpra/client/gui/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def __init__(self): # pylint: disable=super-init-not-called

# state:
self._on_handshake: Sequence[tuple[Callable, Sequence[Any]]] | None = []
self._on_server_setting_changed: dict[str, Sequence[Callable]] = {}
self._on_server_setting_changed: dict[str, Sequence[Callable[[str, Any], None]]] = {}

def init(self, opts) -> None:
""" initialize variables from configuration """
Expand Down Expand Up @@ -580,7 +580,7 @@ def after_handshake(self, cb: Callable, *args) -> None:
def _process_server_event(self, packet: PacketType) -> None:
log(": ".join(str(x) for x in packet[1:]))

def on_server_setting_changed(self, setting: str, cb: Callable) -> None:
def on_server_setting_changed(self, setting: str, cb: Callable[[str, Any], None]) -> None:
self._on_server_setting_changed.setdefault(setting, []).append(cb)

def _process_setting_change(self, packet: PacketType) -> None:
Expand All @@ -606,7 +606,7 @@ def _process_setting_change(self, packet: PacketType) -> None:
return
log("_process_setting_change: %s=%s", setting, Ellipsizer(value))
# these are too big to log
if setting not in ("xdg-menu", "monitors"):
if setting not in ("xdg-menu", "monitors", "ibus-layouts"):
log.info("server setting changed: %s=%s", setting, repr_ellipsized(value))
self.server_setting_changed(setting, value)

Expand Down

0 comments on commit 73ab86e

Please sign in to comment.