https://bugzilla.redhat.com/show_bug.cgi?id=2171140
--- Comment #13 from Mike FABIAN <mfabian(a)redhat.com> ---
I find it also very strange that the traceback complains about a missing
_set_get_functions
Traceback (most recent call last):
File "/usr/share/ibus-typing-booster/engine/hunspell_table.py", line 7038, in
on_gsettings_value_changed
if (key in self._set_get_functions
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TypingBoosterEngine' object has no attribute
'_set_get_functions'
because that exists:
mfabian@hathi:/local/mfabian/src/ibus-typing-booster ((2.21.3) $)
$ git grep self._set_get_functions
engine/hunspell_table.py: self._set_get_functions: Dict[str, Dict[str,
Any]] = {
engine/hunspell_table.py: or setting not in
self._set_get_functions
engine/hunspell_table.py: or 'set' not in
self._set_get_functions[setting]
engine/hunspell_table.py: or 'get' not in
self._set_get_functions[setting]):
engine/hunspell_table.py: current_value =
self._set_get_functions[setting]['get']()
engine/hunspell_table.py: self._set_get_functions[setting]['set'](
engine/hunspell_table.py: self._set_get_functions[setting]['set'](
engine/hunspell_table.py: if (key in self._set_get_functions
engine/hunspell_table.py: and 'set' in
self._set_get_functions[key]):
engine/hunspell_table.py: self._set_get_functions[key]['set'](value,
update_gsettings=False)
lines 1-10/10 (END)
And when I trigger the call of the `on_gsettings_value_changed` function on the
command line with
$ dconf write /org/freedesktop/ibus/engine/typing-booster/dictionary
"'en_US_POSIX,fr,fr_FR'"
$ dconf write /org/freedesktop/ibus/engine/typing-booster/dictionary
"'de_DE,it_IT,en_GB,fr_FR'"
I see that the function is called in the debug log, and not only is it called
but it does what it is supposed to do, i.e. change the dictionary settings.
mfabian@hathi:~
$ tail -F ~/.local/share/ibus-typing-booster/debug.log | grep
on_gsettings_value
2023-02-21 21:26:23,712 hunspell_table.py line 7037 on_gsettings_value_changed
DEBUG: Settings changed: key=dictionary value=en_US_POSIX,fr,fr_FR
2023-02-21 21:26:30,395 hunspell_table.py line 7037 on_gsettings_value_changed
DEBUG: Settings changed: key=dictionary value=de_DE,it_IT,en_GB,fr_FR
That function is very simple:
def on_gsettings_value_changed(
self, _settings: Gio.Settings, key: str) -> None:
'''
Called when a value in the settings has been changed.
:param settings: The settings object
:param key: The key of the setting which has changed
'''
value = itb_util.variant_to_value(self._gsettings.get_value(key))
LOGGER.debug('Settings changed: key=%s value=%s\n', key, value)
if (key in self._set_get_functions
and 'set' in self._set_get_functions[key]):
self._set_get_functions[key]['set'](value, update_gsettings=False)
return
LOGGER.warning('Unknown key\n')
return
and if it failed as in the backtrace, I would not see the effect of setting the
dictionaries.
--
You are receiving this mail because:
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2171140