> Subject: Re: Help with adding wifi connections with python
> From: awilliam whitemice org > To: networkmanager-list gnome org > Date: Mon, 20 Feb 2012 08:27:30 -0500 > > On Sun, 2012-02-19 at 11:02 +0000, Jonas Vikstrom wrote: > > Hello, > > I am trying to move from wicd to network-manager and from a python > > point of view it is not easy. > > I have found a number of libraries but non of them works with Ubuntu > > 11.10 (nm 0.9). > > (the project is wireless manager for xbmc) > > These examples are great > > http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python > > But do not cover more then one example of security setup. > > I have reviewed the code for nmcli but it does not cover create > > connections. > > I am now pretty close by using this example from this list > > http://osdir.com/ml/networkmanager-list/2010-07/msg00107.html > > It exectutes fine with sudo but the password is not set. I have no > > clue how to find more information and I really need some examples. > > s_con = { 'id': 'XXX', 'uuid': '5ef2d781-1197-44eb-8744-cd78b9c07315', > > 'type': '802-11-wireless', 'autoconnect': False, 'name': > > 'connection' } > > s_wifi = { 'ssid': dbus.ByteArray("XXX"), 'mode': 'infrastructure', > > 'security': '802-11-wireless-security', 'name': '802-11-wireless' } > > s_wsec = { 'key-mgmt': 'wpa-psk', 'wpa-key': 'xxx', 'name': > > '802-11-wireless-security' } > > s_ip4 = { 'method': 'auto', 'name': 'ipv4' } > > con = { 'connection': s_con, '802-11-wireless': s_wifi, > > '802-11-wireless-security': s_wsec, 'ipv4': s_ip4 } > > Is the password set by NetworkManager or does NetworkManager use the > GNOME keyring for the passwords? > > I don't know, but I'd check that out. > Thanks for the tip.
I am not sure how to check this. I am struggling to find a source for detailed information about this area.
Of course I can get the source code for nm-connection-editor but is that really the only way?
BTW, I have now tested the same script in vanilla Ubuntu 11.10 with the same result but with no need for sudo, so that is unrelated.
best regards, Jonas
> > This is how far I am nowbefore adding functionality to create > > connections. > > http://dl.dropbox.com/u/17892827/xbmc/vikjon0-py-nm.py > > http://forum.xbmc.org/showthread.php?t=119592 > > > -- > System & Network Administrator [ LPI & NCLA ] > <http://www.whitemiceconsulting.com> > OpenGroupware Developer <http://www.opengroupware.us> > Adam Tauno Williams > > _______________________________________________ > networkmanager-list mailing list > networkmanager-list gnome org > http://mail.gnome.org/mailman/listinfo/networkmanager-list |