2004-08-30 Bryan Clark <clarkbw@cvs.gnome.org>

* 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
This commit is contained in:
Bryan Clark 2004-08-30 04:50:22 +00:00 committed by Bryan W. Clark
parent ee1cb1e400
commit c7be101a65
2 changed files with 20 additions and 2 deletions

View file

@ -1,5 +1,9 @@
2004-08-30 Bryan Clark <clarkbw@cvs.gnome.org>
* 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

View file

@ -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