From 4969c1906501aa2913ddab1050c8c3fca0277bca Mon Sep 17 00:00:00 2001 From: Bartlomiej Cieszkowski Date: Sun, 9 Feb 2020 20:34:32 +0100 Subject: [PATCH] glances can work in console mode on windows - windows-curses --- glances/main.py | 4 ---- glances/outputs/glances_curses.py | 17 +++++++++-------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/glances/main.py b/glances/main.py index dad17e6f..a869e3cb 100644 --- a/glances/main.py +++ b/glances/main.py @@ -305,10 +305,6 @@ Examples of use: if args.disable_autodiscover: logger.info("Auto discover mode is disabled") - # By default Windows is started in Web mode - if WINDOWS: - args.webserver = True - # In web server mode if args.webserver: args.process_short_name = True diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py index 782a1a32..b78c9857 100644 --- a/glances/outputs/glances_curses.py +++ b/glances/outputs/glances_curses.py @@ -31,14 +31,15 @@ from glances.processes import glances_processes from glances.timer import Timer # Import curses library for "normal" operating system -if not WINDOWS: - try: - import curses - import curses.panel - from curses.textpad import Textbox - except ImportError: - logger.critical("Curses module not found. Glances cannot start in standalone mode.") - sys.exit(1) +try: + import curses + import curses.panel + from curses.textpad import Textbox +except ImportError: + logger.critical("Curses module not found. Glances cannot start in standalone mode.") + if WINDOWS: + logger.critical("For Windows you can try installing windows-curses with pip install.") + sys.exit(1) class _GlancesCurses(object):