I’m using Network Manager (NM 1.0) from PyGObject to create a widget that can show and connect to a network. I created a subclass of NM.SecretAgentOld
to provide passwords to NM, basically I just overwrite the virtual method
def do_get_secrets(
self,
connection,
connection_path,
setting_name,
hints,
flags,
callback,
*callback_data
):
<after retrieving the password>
<convert password to GLib.Variant>
callback(self, connection, password, None)
And after retrieving the password I simply call the callback
provided by NM. However callback
(or more specifically NM.SecretAgentOldGetSecretsFunc
type) takes 4th argument as a GLib.Error
in case of any error. But it doesn’t mention what to use when there’s no error and using None
raises a type error. The example from the official Network Manager python example (Making sure you're not a bot!) also shows type error.
How can I fix this?