2004-08-30 Bryan Clark <clarkbw@cvs.gnome.org>
* examples/python/NetworkManager.py: added convience functions has_wired_device and has_wireless_device * examples/python/systray/network_tray.py: cleaned up a bunch of cruft, added support for listing wireless networks just like the real applet. This is probably all I'm going to work on this applet from now on. TODO: add support for actually changing networks and devices git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@111 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:

committed by
Bryan W. Clark

parent
b2fb0f8b0d
commit
3e02531372
@@ -147,6 +147,18 @@ class NetworkManager:
|
||||
"""
|
||||
def get_all_devices(self):
|
||||
return self.__devices.values()
|
||||
|
||||
def _has_type_device (self, type):
|
||||
for device in self.get_devices():
|
||||
if device["nm.type"] == type:
|
||||
return True
|
||||
return False
|
||||
|
||||
def has_wired_device(self):
|
||||
return self._has_type_device(WIRED_DEVICE)
|
||||
|
||||
def has_wireless_device(self):
|
||||
return self._has_type_device(WIRELESS_DEVICE)
|
||||
|
||||
def _get_hal_info(self, udi):
|
||||
hal_devices = self._hal_manager.FindDeviceStringMatch("info.udi",
|
||||
|
Reference in New Issue
Block a user