Skip to content

Instantly share code, notes, and snippets.

@clefebvre
Created April 24, 2018 15:56
Show Gist options
  • Select an option

  • Save clefebvre/411ab17558fc4dc438085ce2b6cc9093 to your computer and use it in GitHub Desktop.

Select an option

Save clefebvre/411ab17558fc4dc438085ce2b6cc9093 to your computer and use it in GitHub Desktop.
libnma issue in Debian stretch
#!/usr/bin/python3
import gi
gi.require_version('NM', '1.0')
gi.require_version('NMA', '1.0')
gi.require_version('Gtk', '3.0')
from gi.repository import NM
#from gi.repository import NMA
from gi.repository import Gtk
def client_ready(obj, result):
client = NM.Client.new_finish(result)
for connection in client.get_connections():
settings = connection.get_setting_by_name(NM.SETTING_CONNECTION_SETTING_NAME)
print (settings.get_id())
NM.Client.new_async(None, client_ready)
Gtk.main()
@clefebvre
Copy link
Author

This python script uses libnm to list the network connections.

The GIR for libnma is broken in Debian stretch. Importing libnma makes it impossible to use libnm, and vice-versa.

Uncomment line 10 to make the script crash in Debian stretch.

This is fixed upstream by https://git.gnome.org/browse/network-manager-applet/commit/?id=7a59d41e5f6666d0da51f1f7aae7518befdb1182.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment