From 4fca00f85539a68f193acc2069d6e2d7202eb9e8 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Wed, 23 Sep 2009 14:42:20 -0300 Subject: sorting interfaces --- net_monitor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net_monitor.py b/net_monitor.py index e80fc31..7360f5f 100755 --- a/net_monitor.py +++ b/net_monitor.py @@ -272,7 +272,10 @@ class Monitor: self.ifaces = readnet() self.enabled_ifaces = [] - for iface in self.ifaces: + sorted_ifaces = self.ifaces.keys() + sorted_ifaces.sort() + + for iface in sorted_ifaces: data_in, data_out = get_traffic(iface) self.ifaces[iface] = {'data_in': 0, 'data_out': 0, -- cgit v1.2.1