mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-04 07:34:49 +03:00
Merge branch 'develop' of https://github.com/nicolargo/glances into develop
This commit is contained in:
commit
e16157996b
@ -27,7 +27,7 @@ It uses the `psutil`_ library to get information from your system.
|
||||
Requirements
|
||||
============
|
||||
|
||||
- ``python >= 2.6`` (tested with version 2.6, 2.7, 3.3, 3.4)
|
||||
- ``python >= 2.6`` or ``>= 3.3`` (tested with version 2.6, 2.7, 3.3, 3.4)
|
||||
- ``psutil >= 2.0.0``
|
||||
- ``setuptools``
|
||||
|
||||
|
@ -44,21 +44,17 @@ from glances.core.glances_globals import gettext_domain, locale_dir
|
||||
from glances.core.glances_logging import logger
|
||||
from glances.core.glances_main import GlancesMain
|
||||
|
||||
# Get PSutil version
|
||||
psutil_min_version = (2, 0, 0)
|
||||
psutil_version = tuple([int(num) for num in __psutil_version.split('.')])
|
||||
|
||||
# First log with Glances and PSUtil version
|
||||
logger.info('Start Glances {0}'.format(__version__))
|
||||
logger.info('{0} {1} and PSutil {2} detected'.format(platform.python_implementation(),
|
||||
platform.python_version(),
|
||||
__psutil_version))
|
||||
|
||||
# Check PSutil version
|
||||
if psutil_version < psutil_min_version:
|
||||
logger.critical('PSutil 2.0 or higher is needed. Glances cannot start.')
|
||||
# Check Python version
|
||||
if sys.version_info < (2, 6) or (3, 0) <= sys.version_info < (3, 3):
|
||||
print('Glances requires at least Python 2.6 or 3.3 to run.')
|
||||
sys.exit(1)
|
||||
|
||||
# Check PSutil version
|
||||
psutil_min_version = (2, 0, 0)
|
||||
psutil_version = tuple([int(num) for num in __psutil_version.split('.')])
|
||||
if psutil_version < psutil_min_version:
|
||||
print('PSutil 2.0 or higher is needed. Glances cannot start.')
|
||||
sys.exit(1)
|
||||
|
||||
def __signal_handler(signal, frame):
|
||||
"""Callback for CTRL-C."""
|
||||
@ -94,6 +90,13 @@ def main():
|
||||
Select the mode (standalone, client or server)
|
||||
Run it...
|
||||
"""
|
||||
# Log Glances and PSutil version
|
||||
logger.info('Start Glances {0}'.format(__version__))
|
||||
logger.info('{0} {1} and PSutil {2} detected'.format(
|
||||
platform.python_implementation(),
|
||||
platform.python_version(),
|
||||
__psutil_version))
|
||||
|
||||
# Setup translations
|
||||
try:
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
|
Loading…
Reference in New Issue
Block a user