tools: return the full svg path for ratbagc get_svg()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2018-09-06 08:10:41 +10:00
committed by Benjamin Tissoires
parent dfeac1bcbc
commit 34fbfe105c
2 changed files with 3 additions and 1 deletions

View File

@@ -580,6 +580,7 @@ shared_library(
ratbagc_py_conf = configuration_data()
ratbagc_py_conf.set('LIBRATBAG_DATA_DIR', libratbag_data_dir_devel)
ratbagc_py = configure_file(input: 'tools/ratbagc.py.in',
output: 'ratbagc.py',
configuration: ratbagc_py_conf)

View File

@@ -27,6 +27,7 @@ import sys
from evdev import ecodes
LIBRATBAG_DATA_DIR = "@LIBRATBAG_DATA_DIR@"
# Deferred translations, see https://docs.python.org/3/library/gettext.html#deferred-translations
def N_(x):
@@ -281,7 +282,7 @@ class RatbagdDevice(metaclass=MetaRatbag):
@param theme The theme from which to retrieve the SVG, as str
"""
return os.path.join(theme, libratbag.ratbag_device_get_svg_name(self._device))
return os.path.join(LIBRATBAG_DATA_DIR, theme, libratbag.ratbag_device_get_svg_name(self._device))
def commit(self, callback=None):
"""Commits all changes made to the device.