aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2015-09-30 19:34:38 +0200
committerPapoteur <papoteur@mageialinux-online.org>2015-09-30 19:34:38 +0200
commit13bf8bf0e5454950731b1d9d287ca1455576cb97 (patch)
tree6b5d1372d06ab6099cd20c6fd0c90ce9e1e158b7 /src
parent8eaf3a17577b717903d31f035143458d6c9fefda (diff)
downloadnet_monitor-13bf8bf0e5454950731b1d9d287ca1455576cb97.tar
net_monitor-13bf8bf0e5454950731b1d9d287ca1455576cb97.tar.gz
net_monitor-13bf8bf0e5454950731b1d9d287ca1455576cb97.tar.bz2
net_monitor-13bf8bf0e5454950731b1d9d287ca1455576cb97.tar.xz
net_monitor-13bf8bf0e5454950731b1d9d287ca1455576cb97.zip
Allow reading Png image for statistics
Diffstat (limited to 'src')
-rwxr-xr-xsrc/net_monitor4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/net_monitor b/src/net_monitor
index 1c347ed..fb3c834 100755
--- a/src/net_monitor
+++ b/src/net_monitor
@@ -11,6 +11,7 @@ from gi.repository import Pango
import gc
import os
+import subprocess
from stat import *
import datetime
import getopt
@@ -834,7 +835,8 @@ class MonitorGui:
# show summary if parameter is unknown
print("Unknown parameter %s, showing summary.." % type)
param="-s"
- data = os.popen("vnstati %s -o - -i %s" % (param, iface)).read()
+ pr = subprocess.Popen(("vnstati %s -o - -i %s" % (param, iface)).split(),stdout=subprocess.PIPE)
+ data, _ = pr.communicate()
loader = GdkPixbuf.PixbufLoader()
loader.write(data)
loader.close()