summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolargo <nicolas@nicolargo.com>2014-10-09 22:21:12 +0200
committerNicolargo <nicolas@nicolargo.com>2014-10-09 22:21:12 +0200
commitb93a51348c065c4660d16798208574997baf57b6 (patch)
treeaa9932c8c4b79bda185cd3f2334cbe98e10ce225
parent287af37541cc4b45f46e9968afac535d76404faf (diff)
parent45b78474e464b88253071713794cd6d69a697890 (diff)
Merge branch 'release/v2.1.2'v2.1.2
-rw-r--r--.gitignore3
-rw-r--r--NEWS9
-rw-r--r--docs/glances-doc.html2
-rw-r--r--docs/glances-doc.rst2
-rw-r--r--glances/__init__.py2
-rw-r--r--glances/core/glances_processes.py3
-rw-r--r--glances/core/glances_standalone.py4
-rw-r--r--glances/plugins/glances_processlist.py8
-rw-r--r--man/glances.12
-rwxr-xr-xsetup.py2
-rw-r--r--tox.ini23
-rwxr-xr-xunitest-restful.py2
-rwxr-xr-xunitest-xmlrpc.py8
13 files changed, 57 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index c80ac56e..27ff31f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,6 @@ local.properties
# Sphinx
_build
+
+# Tox
+.tox/
diff --git a/NEWS b/NEWS
index 01b911a8..f4055f2a 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,15 @@
Glances Version 2.x
==============================================================================
+Version 2.1.2
+=============
+
+ Maintenance version (only needed for Mac OS X).
+
+Bugs corrected:
+
+ * Mac OS X: Error if Glances is not ran with sudo (issue #426)
+
Version 2.1.1
=============
diff --git a/docs/glances-doc.html b/docs/glances-doc.html
index 719e69e3..32121e8c 100644
--- a/docs/glances-doc.html
+++ b/docs/glances-doc.html
@@ -123,7 +123,7 @@ td.option-group {
<div class="document" id="glances">
<h1 class="title">Glances</h1>
-<p>This manual describes <em>Glances</em> version 2.1.1.</p>
+<p>This manual describes <em>Glances</em> version 2.1.2.</p>
<p>Copyright © 2012-2014 Nicolas Hennion &lt;<a class="reference external" href="mailto:nicolas&#64;nicolargo.com">nicolas&#64;nicolargo.com</a>&gt;</p>
<p>October 2014</p>
<div class="contents topic" id="table-of-contents">
diff --git a/docs/glances-doc.rst b/docs/glances-doc.rst
index a2b1932e..db28942e 100644
--- a/docs/glances-doc.rst
+++ b/docs/glances-doc.rst
@@ -2,7 +2,7 @@
Glances
=======
-This manual describes *Glances* version 2.1.1.
+This manual describes *Glances* version 2.1.2.
Copyright © 2012-2014 Nicolas Hennion <nicolas@nicolargo.com>
diff --git a/glances/__init__.py b/glances/__init__.py
index 18b9743a..8d3b9b96 100644
--- a/glances/__init__.py
+++ b/glances/__init__.py
@@ -20,7 +20,7 @@
"""Init the Glances software."""
__appname__ = 'glances'
-__version__ = '2.1.1'
+__version__ = '2.1.2'
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
__license__ = 'LGPL'
diff --git a/glances/core/glances_processes.py b/glances/core/glances_processes.py
index d67de058..7eea8259 100644
--- a/glances/core/glances_processes.py
+++ b/glances/core/glances_processes.py
@@ -147,6 +147,9 @@ class GlancesProcesses(object):
# Process CPU, MEM percent and name
procstat.update(proc.as_dict(attrs=['cpu_percent', 'memory_percent', 'name'], ad_value=''))
+ if procstat['cpu_percent'] == '' or procstat['memory_percent'] == '':
+ # Do not display process if we can not get the basic cpu_percent or memory_percent stats
+ return None
# Process command line (cached with internal cache)
try:
diff --git a/glances/core/glances_standalone.py b/glances/core/glances_standalone.py
index 4fe860da..65ce03b5 100644
--- a/glances/core/glances_standalone.py
+++ b/glances/core/glances_standalone.py
@@ -34,8 +34,8 @@ class GlancesStandalone(object):
# Init stats
self.stats = GlancesStats(config=config, args=args)
- # Default number of processes to displayed is set to 20
- glances_processes.set_max_processes(20)
+ # Default number of processes to displayed is set to 50
+ glances_processes.set_max_processes(50)
# If process extended stats is disabled by user
if args.disable_process_extended:
diff --git a/glances/plugins/glances_processlist.py b/glances/plugins/glances_processlist.py
index fca5e6f8..3262d72d 100644
--- a/glances/plugins/glances_processlist.py
+++ b/glances/plugins/glances_processlist.py
@@ -261,8 +261,7 @@ class Plugin(GlancesPlugin):
msg += _('swap ') + self.auto_unit(p['memory_swap'], low_precision=False)
ret.append(self.curse_add_line(msg, splittable=True))
# Third line is for openned files/network sessions
- ret.append(self.curse_new_line())
- msg = xpad + _('Openned: ')
+ msg = ''
if 'num_threads' in p and p['num_threads'] is not None:
msg += _('threads ') + str(p['num_threads']) + ' '
if 'num_fds' in p and p['num_fds'] is not None:
@@ -273,7 +272,10 @@ class Plugin(GlancesPlugin):
msg += _('TCP ') + str(p['tcp']) + ' '
if 'udp' in p and p['udp'] is not None:
msg += _('UDP ') + str(p['udp']) + ' '
- ret.append(self.curse_add_line(msg, splittable=True))
+ if msg != '':
+ ret.append(self.curse_new_line())
+ msg = xpad + _('Openned: ') + msg
+ ret.append(self.curse_add_line(msg, splittable=True))
# Fouth line is IO nice level (only Linux and Windows OS)
if 'ionice' in p and p['ionice'] is not None:
ret.append(self.curse_new_line())
diff --git a/man/glances.1 b/man/glances.1
index d8cd2951..57f9dbcd 100644
--- a/man/glances.1
+++ b/man/glances.1
@@ -1,4 +1,4 @@
-.TH glances 1 "October, 2014" "version 2.1.1" "USER COMMANDS"
+.TH glances 1 "October, 2014" "version 2.1.2" "USER COMMANDS"
.SH NAME
glances \- A cross-platform curses-based system monitoring tool
.SH SYNOPSIS
diff --git a/setup.py b/setup.py
index 9013a503..5261214a 100755
--- a/setup.py
+++ b/setup.py
@@ -40,7 +40,7 @@ def get_requires():
setup(
name='Glances',
- version='2.1.1',
+ version='2.1.2',
description="A cross-platform curses-based monitoring tool",
long_description=open('README.rst').read(),
author='Nicolas Hennion',
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 00000000..638e17f9
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,23 @@
+# Tox (http://tox.testrun.org/) is a tool for running tests
+# Install:
+# pip install tox
+# Run:
+# tox
+
+[tox]
+envlist = py27, py34
+
+[testenv]
+deps =
+ flake8
+ requests
+ psutil
+ bottle
+ batinfo
+ https://bitbucket.org/gleb_zhulik/py3sensors/get/tip.tar.gz
+commands =
+ python unitest.py
+ python unitest-restful.py
+ python unitest-xmlrpc.py
+ #flake8 --exclude=build,.tox,.git
+
diff --git a/unitest-restful.py b/unitest-restful.py
index 6f413c8f..061cb13e 100755
--- a/unitest-restful.py
+++ b/unitest-restful.py
@@ -123,7 +123,7 @@ class TestGlances(unittest.TestCase):
plist = requests.get("%s/%s" % (URL, method))
- print plist.json()
+ print(plist.json())
for p in plist.json():
print("HTTP RESTFul request: %s/%s" % (URL, p))
diff --git a/unitest-xmlrpc.py b/unitest-xmlrpc.py
index d1e56d4f..4d14ce13 100755
--- a/unitest-xmlrpc.py
+++ b/unitest-xmlrpc.py
@@ -27,9 +27,13 @@ import time
import unittest
import shlex
import subprocess
-import xmlrpclib
import json
import types
+try:
+ from xmlrpc.client import ServerProxy
+except ImportError:
+ # Python 2
+ from xmlrpclib import ServerProxy
from glances.core.glances_globals import (
appname,
@@ -68,7 +72,7 @@ from glances.core.glances_stats import GlancesStats
stats = GlancesStats()
# Init the XML/RCP client
-client = xmlrpclib.ServerProxy(URL)
+client = ServerProxy(URL)
# Unitest class
# ==============