I need to pass a GObject.ParamSpecString
to a function in a 3rd party API (Gimp 3.0). The docs on https://lazka.github.io/pgi-docs/#GObject-2.0/functions.html#GObject.param_spec_string say that GObject.param_spec_string(name, nick, blurb, default_value, flags)
“Creates a new GObject.ParamSpecString instance.” But when I use the object returned from param_spec_string()
, the api complains TypeError: argument pspec: Expected GObject.ParamSpec, but got gobject.GParamSpec
host_name_pspec: GObject.ParamSpec
host_name_pspec = GObject.param_spec_string(name="host-name",
nick="hostname",
blurb="The hostname of the ComfyUI server. "
"If installed locally, use "localhost"",
default_value="localhost",
flags=GObject.ParamFlags.READWRITE
)
LOGGER_GCUI.warning(host_name_pspec.__gtype__)
LOGGER_GCUI.warning(dir(host_name_pspec))
procedure.add_argument(host_name_pspec)
>> <GType GParamString (525033632)>
>> ['__doc__', '__gtype__', 'blurb', 'cset_first', 'cset_nth', 'default_value', 'ensure_non_null', 'flags', 'name', 'nick', 'null_fold_if_empty', 'owner_type', 'substitutor', 'value_type']
>> TypeError: argument pspec: Expected GObject.ParamSpec, but got gobject.GParamSpec
Am I doing something wrong? Is this a bug in the (unfinished+unstable) Gimp 3.0 API? Or a bug in PYObject?