pygobject regression by new instance-parameter gir output
Hello, commit 0fb03903 / #1128 (closed) seems to have caused a regression in pygobject. I'm developing the peasy plugin for Geany (https://github.com/kugel-/peasy/), which uses libpeas to provide Python-based plugins for Geany.
The plugins must implement an interface. One such method is the enable method. The GIR for that method has the new instance-parameter
. It seems that pygobject either does not now how to handle it at all, or now generates one more parameter
When a Python plugin is loaded, I get this error message now:
TypeError: do_enable() missing 1 required positional argument: 'self'
The GIR:
<method name="enable" c:identifier="peasy_plugin_enable">
<return-value transfer-ownership="full">
<type name="gboolean" c:type="gboolean"/>
</return-value>
+ <parameters>
+ <instance-parameter name="self" transfer-ownership="none">
+ <type name="Peasy.Plugin" c:type="PeasyPlugin*"/>
+ </instance-parameter>
+ </parameters>
</method>
<virtual-method name="enable" invoker="enable">
<return-value transfer-ownership="full">
<type name="gboolean" c:type="gboolean"/>
</return-value>
+ <parameters>
+ <instance-parameter name="self" transfer-ownership="none">
+ <type name="Peasy.Plugin" c:type="PeasyPlugin*"/>
+ </instance-parameter>
+ </parameters>
</virtual-method>
Generated vala code:
gboolean
peasy_plugin_enable (PeasyPlugin* self)
{
PeasyPluginClass* _klass_;
g_return_val_if_fail (self != NULL, FALSE);
_klass_ = PEASY_PLUGIN_GET_CLASS (self);
if (_klass_->enable) {
return _klass_->enable (self);
}
return FALSE;
}
The Python side:
def do_enable(self):
return True
Edited by Thomas Martitz