glances can work in console mode on windows - windows-curses

This commit is contained in:
Bartlomiej Cieszkowski 2020-02-09 20:34:32 +01:00
parent 3e5ec443ce
commit 4969c19065
2 changed files with 9 additions and 12 deletions

View File

@ -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

View File

@ -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):