From 13bf8bf0e5454950731b1d9d287ca1455576cb97 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Wed, 30 Sep 2015 19:34:38 +0200 Subject: Allow reading Png image for statistics --- src/net_monitor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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() -- cgit v1.2.1