From c7be101a6540faffbfc889e86fb2f23a742798fc Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Mon, 30 Aug 2004 04:50:22 +0000 Subject: [PATCH] 2004-08-30 Bryan Clark * examples/python/NetworkManager.py (NetworkManager.get_device): changed "nm.networks" into a dict from a list so I can store all the cool information about networks in there git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@109 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 4 ++++ examples/python/NetworkManager.py | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17e918c52..03037b13d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-08-30 Bryan Clark + * examples/python/NetworkManager.py (NetworkManager.get_device): + changed "nm.networks" into a dict from a list so I can store all + the cool information about networks in there + * examples/python/systray/network_tray.py: Added nice message when you try to run without running make first diff --git a/examples/python/NetworkManager.py b/examples/python/NetworkManager.py index 143673a0f..f9d29f200 100755 --- a/examples/python/NetworkManager.py +++ b/examples/python/NetworkManager.py @@ -27,7 +27,7 @@ class NetworkManager: NM_SIGNALS = [ "DeviceNoLongerActive", "DeviceNowActive", "DeviceActivating", - "DevicesChanging", + "DevicesChanged", "DeviceIP4AddressChange", "WirelessNetworkDisappeared", "WirelessNetworkAppeared" @@ -88,7 +88,21 @@ class NetworkManager: pass try: - d["nm.networks"] = nm_device_object.getNetworks(device) + d["nm.networks"] = {} + networks = nm_device_object.getNetworks(device) + for network in networks: + nm_network_object = self._nm_service.get_object(network, + NM_INTERFACE_DEVICES) + n = {} + n["name"] = nm_network_object.getName() + n["address"] = nm_network_object.getAddress() + n["quality"] = nm_network_object.getQuality() + n["frequency"] = nm_network_object.getFrequency() + n["rate"] = nm_network_object.getRate() + n["encrypted"] = nm_network_object.getEncrypted() + + d["nm.networks"][network] = n + except DBusException, e: pass