From 4a4e71121296d774f35cdc5cdc46b852482c7160 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Fri, 13 Jan 2012 13:16:16 +0100 Subject: [PATCH] Minor update --- src/glances.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/glances.py b/src/glances.py index 1ebcce69..61f2c9b7 100755 --- a/src/glances.py +++ b/src/glances.py @@ -25,15 +25,21 @@ import sys import signal import time import datetime -import statgrab import multiprocessing +try: + import statgrab +except: + print 'Statgrab initialization failed, Glances cannot start.' + print '' + sys.exit(1) + try: import curses import curses.panel except: - print 'Textmode GUI initialization failed, Glances cannot start.' - print + print 'Curses initialization failed, Glances cannot start.' + print '' sys.exit(1) # Globals variables @@ -130,8 +136,11 @@ class glancesStats(): if not statgrab.sg_init(): print "Error: Can not init the libstatgrab library.\n" - # Init the interfac fs stats - self.glancesgrabfs = glancesGrabFs() + # Init the fs stats + try: + self.glancesgrabfs = glancesGrabFs() + except: + self.glancesgrabfs = {} # Do the first update self.__update__()