From be2ddb1a846ab791c9c63788484b3995bde60f6e Mon Sep 17 00:00:00 2001 From: Nicolas Hennion Date: Fri, 28 Mar 2014 09:30:36 +0100 Subject: [PATCH] No problem on run... --- glances/core/glances_standalone.py | 6 +----- glances/outputs/glances_curses.py | 2 ++ glances/plugins/glances_cpu.py | 4 +--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/glances/core/glances_standalone.py b/glances/core/glances_standalone.py index 89a99243..28a2baa9 100644 --- a/glances/core/glances_standalone.py +++ b/glances/core/glances_standalone.py @@ -33,13 +33,9 @@ class GlancesStandalone(): # Init stats self.stats = GlancesStats(config) - # Initial update - # !!! The first time Glances display wrong CPU/MEM information + # Initial system informations update self.stats.update() - # !!! Usefull ? - self.refresh_time = args.time - # Init HTML output # !!! TODO # if html_tag: diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py index 8efb1606..775d1481 100644 --- a/glances/outputs/glances_curses.py +++ b/glances/outputs/glances_curses.py @@ -41,6 +41,7 @@ class glancesCurses: # Init args self.args = args + # By default, display bitrate instead of cumulative in the network plugin self.args.network_stats_cumulative = False @@ -56,6 +57,7 @@ class glancesCurses: self.screen = curses.initscr() if not self.screen: print(_("Error: Cannot init the curses library.\n")) + sys.exit(1) # Set curses options if hasattr(curses, 'start_color'): diff --git a/glances/plugins/glances_cpu.py b/glances/plugins/glances_cpu.py index 50ff37f6..42e6718d 100644 --- a/glances/plugins/glances_cpu.py +++ b/glances/plugins/glances_cpu.py @@ -58,9 +58,7 @@ class Plugin(GlancesPlugin): """ # Grab CPU using the PSUtil cpu_times_percent method - # !!! the first time this function is called with interval = 0.0 or None - # !!! it will return a meaningless 0.0 value which you are supposed to ignore - cputimespercent = cpu_times_percent(interval=0, percpu=False) + cputimespercent = cpu_times_percent(interval=0.0, percpu=False) # Get all possible value for CPU stats # user -- GitLab