Split utility functions, fixing 06 a bit.
[cnetworkmanager.git] / connection06.py
blobd44f370438a9ca2539512a31c74e6d8a3ccc8b20
1 from util import *
3 class cConnection_06:
4 def __init__(self, applet, id):
5 self.id = id
6 self.applet = applet
8 def Dump(self):
9 print "Conn:", self.id
11 np = self.applet.ii.getNetworkProperties(self.id, NETWORK_TYPE_ALLOWED)
12 ssid = np[0]
13 print " ssid:", ssid
14 print " time:", dump_time(np[1])
15 print " trusted:", bool(np[2])
16 print " bssids:", ", ".join(np[3])
17 enctype = np[4]
18 print " we_cipher:", enctype
19 if enctype != 1:
20 print " secret:", np[5]
21 if enctype == 16:
22 print " wep_auth_algorithm:", np[6]
23 elif enctype == 0:
24 print " wpa_psk_key_mgt:", np[6]
25 print " wpa_psk_wpa_version:", np[7]
27 return # nm-applet will not tell kfn anyway
28 devp = "/org/freedesktop/NetworkManager/Devices/ath0" #FIXME
29 netp = devp + "/Networks/" + opath_escape(self.id)
30 attempt = 1
31 newkey = False
32 kfn = self.applet.ii.getKeyForNetwork(devp, netp, ssid, attempt, newkey)
33 print " kfn:", kfn