From b106370bd8b54ee7459cb9f55a76ab475729ad4d Mon Sep 17 00:00:00 2001 From: nicolargo Date: Tue, 27 Dec 2016 12:29:58 +0100 Subject: [PATCH] Add debug message for the load of maximum processes to display in the WebUI --- glances/outputs/glances_bottle.py | 11 +++++++++++ glances/outputs/glances_curses.py | 3 +++ 2 files changed, 14 insertions(+) diff --git a/glances/outputs/glances_bottle.py b/glances/outputs/glances_bottle.py index 8a5d5896..8a39ee7d 100644 --- a/glances/outputs/glances_bottle.py +++ b/glances/outputs/glances_bottle.py @@ -56,6 +56,9 @@ class GlancesBottle(object): # since last update is passed (will retrieve old cached info instead) self.timer = Timer(0) + # Load configuration file + self.load_config(config) + # Init Bottle self._app = Bottle() # Enable CORS (issue #479) @@ -69,6 +72,14 @@ class GlancesBottle(object): # Path where the statics files are stored self.STATIC_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'static/public') + def load_config(self, config): + """Load the outputs section of the configuration file.""" + # Limit the number of processes to display in the WebUI + if config is not None and config.has_section('outputs'): + logger.debug('Read number of processes to display in the WebUI') + n = config.get_value('outputs', 'max_processes_display', default=None) + logger.debug('Number of processes to display in the WebUI: {}'.format(n)) + def __update__(self): # Never update more than 1 time per cached_time if self.timer.finished(): diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py index ebe126cd..ebe4d3ac 100644 --- a/glances/outputs/glances_curses.py +++ b/glances/outputs/glances_curses.py @@ -109,6 +109,9 @@ class _GlancesCurses(object): # - Init the theme (default is black) self.theme = {'name': 'black'} + # Load configuration file + self.load_config(config) + # Init cursor self._init_cursor()