Merge branch 'develop' of https://github.com/nicolargo/glances into develop

This commit is contained in:
nicolargo 2015-03-11 20:07:09 +01:00
commit e16157996b
3 changed files with 20 additions and 14 deletions

View File

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

View File

@ -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, '')

View File

@ -8,6 +8,9 @@ from setuptools import setup
is_chroot = os.stat('/').st_ino != 2
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)
def get_data_files():
data_files = [