aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.com>2011-01-16 15:15:57 -0200
committerEugeni Dodonov <eugeni@mandriva.com>2011-01-16 15:15:57 -0200
commitfcadf92c88199fdd1ebec0e5762fb14407938dc9 (patch)
treed0845d8c523cda8aa9321b92ed6cf596b57c3d82 /src
parentf11fdceb0d5713d0b6e00257f1431a0d20bb1f41 (diff)
downloadnet_monitor-fcadf92c88199fdd1ebec0e5762fb14407938dc9.tar
net_monitor-fcadf92c88199fdd1ebec0e5762fb14407938dc9.tar.gz
net_monitor-fcadf92c88199fdd1ebec0e5762fb14407938dc9.tar.bz2
net_monitor-fcadf92c88199fdd1ebec0e5762fb14407938dc9.tar.xz
net_monitor-fcadf92c88199fdd1ebec0e5762fb14407938dc9.zip
improved check for network accounting
Diffstat (limited to 'src')
-rw-r--r--src/monitor.py2
-rwxr-xr-xsrc/net_monitor6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/monitor.py b/src/monitor.py
index 53bfdd0..bc9c323 100644
--- a/src/monitor.py
+++ b/src/monitor.py
@@ -213,7 +213,7 @@ class Monitor:
traceback.print_exc()
return net
- def check_network_accounting(self, iface):
+ def has_network_accounting(self, iface):
"""Checks if network accounting was enabled on interface"""
try:
os.stat("/var/lib/vnstat/%s" % iface)
diff --git a/src/net_monitor b/src/net_monitor
index 6934741..117ddc4 100755
--- a/src/net_monitor
+++ b/src/net_monitor
@@ -325,7 +325,7 @@ class MonitorGui:
cur_page = self.notebook.append_page(iface_stat, iface_label)
if default_iface and iface == default_iface:
select_page = cur_page
- if self.monitor.check_network_accounting(iface):
+ if self.monitor.has_network_accounting(iface):
self.enabled_ifaces.append(iface)
# finally, we have tabs for network connections
@@ -504,7 +504,7 @@ class MonitorGui:
)
# statistics vbox
stats_vbox = dialog.vbox
- if self.monitor.check_network_accounting(iface):
+ if self.monitor.has_network_accounting(iface):
# graph
graph_vnstat = gtk.Image()
pixbuf = self.load_graph_from_vnstat(iface, type="summary")
@@ -731,7 +731,7 @@ class MonitorGui:
frame_accounting = gtk.Frame(_("Traffic accounting"))
vbox = gtk.VBox()
frame_accounting.add(vbox)
- if self.monitor.check_network_accounting(iface):
+ if self.monitor.has_network_accounting(iface):
iface_u, iface_uptime = self.build_value_pair(sizegroup1, _("Connection time:"))
self.ifaces[iface]["widget_uptime"] = iface_uptime
vbox.pack_start(iface_u, False, False)