I'm following http://www.micahcarrick.com/gsettings-python-gnome-3.html to use GSettings from python, and I've succeeded to read a value:
from gi.repository import Gio
gso=Gio.Settings.new("org.gnome.desktop.wm.preferences")
gso.get_value("focus-mode")
This returns a "GLib.Variant", one of a set of enum values. To get valid enums I can set, I use:
gso.get_range("focus-mode")
However, the docs say
g_settings_get_range has been deprecated since version 2.40 and should not be used in newly-written code. Use g_settings_schema_key_get_range() instead.
So, how do I use g_settings_schema_key_get_range from python?
More generally, how can I introspect Gio to work out how to use it from python given the C docs?
You can use the regular python interpreter inspection:
...etc. It's not always very helpful but at least you can see whether a function exists in a namespace. Based on the docs, I would expect something like this to work: