Gio.bus_get_sync may return None when the DBus service is not available (see
libratbag/piper#2). In addition to this, the service may time out when it is
being started in which case Gio.DBusProxy.new_sync will raise a GLib.Gerror.
This commit checks for both scenarios and raises a RatbagdDBusUnavailable
exception when either one of them occurs. This will in turn be caught in for
example Piper to properly deal with this.
This is the terminology used in libratbag as well (and everywhere else where
we deal with input devices).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Strings can suffer from locale issues, the official recommendation for DBus
APIs is to use enums here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Strings can suffer from locale issues, the official recommendation for DBus
APIs is to use enums here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Exporting just the filename requires the caller to know where that file sits.
That's useful for things like e.g. icons where callers may several sets to
chose from but here most callers will just use the default svg provided by
libratbag.
Export that, so that we don't have build-time dependencies in the callers just
for that single path.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
It's a lot easier to interact with ratbagd from a python script than it is
with C code. Plus this means we test the bindings whenever we use ratbagctl.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>