From 34196c9960e3ade7c1d718b270e7d80e8550efd7 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 25 Jul 2017 18:23:25 +0200 Subject: [PATCH] tools: ratbagd.py: add readwrite=False when we are using explicit setters Assigning an action on a button has some side effects, and this is why we do not have writable properties on those. Mark the _set_dbus_property() as read only so we do not get a bunch of PropertyReadOnly exceptions. Signed-off-by: Benjamin Tissoires --- tools/ratbagd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ratbagd.py b/tools/ratbagd.py index 94a66cfe..ab9841d5 100644 --- a/tools/ratbagd.py +++ b/tools/ratbagd.py @@ -491,7 +491,7 @@ class RatbagdButton(_RatbagdDBus): @param button The button to map to, as int """ ret = self._dbus_call("SetButtonMapping", "u", button) - self._set_dbus_property("ButtonMapping", "u", button) + self._set_dbus_property("ButtonMapping", "u", button, readwrite=False) return ret @GObject.Property @@ -527,7 +527,7 @@ class RatbagdButton(_RatbagdDBus): @param special The special entry, as str """ ret = self._dbus_call("SetSpecialMapping", "s", special) - self._set_dbus_property("SpecialMapping", "s", special) + self._set_dbus_property("SpecialMapping", "s", special, readwrite=False) return ret @GObject.Property @@ -544,7 +544,7 @@ class RatbagdButton(_RatbagdDBus): modifiers. """ ret = self._dbus_call("SetKeyMapping", "au", keys) - self._set_dbus_property("KeyMapping", "au", keys) + self._set_dbus_property("KeyMapping", "au", keys, readwrite=False) return ret @GObject.Property