From 04befb47c75fa226003be2d04853809e94029c35 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 24 Jan 2021 20:59:03 +0100 Subject: Force Ubuntu 20.01 for SNAP --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index f7c1601f..120c4130 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -7,7 +7,7 @@ description: | Web based interface. It can adapt dynamically the displayed information depending on the user interface size. -base: core +base: core20 grade: stable confinement: strict -- cgit v1.2.3 From 4c6c3d78d9d50ac1964776d72fa556c3ea1cffdf Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 24 Jan 2021 21:51:58 +0100 Subject: Resolve SNAP conflict --- snap/snapcraft.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 120c4130..0372ab3f 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -60,11 +60,19 @@ parts: source: https://github.com/bottlepy/bottle.git source-branch: release-0.12 source-depth: 1 + override-build: | + cp -r $SNAPCRAFT_PART_BUILD/dist $SNAPCRAFT_PART_INSTALL/bottle-dist + organize: + bottle-dist: bottle/dist docker: plugin: python source: https://github.com/docker/docker-py.git source-tag: '3.7.3' source-depth: 1 + override-build: | + cp -r $SNAPCRAFT_PART_BUILD/dist $SNAPCRAFT_PART_INSTALL/docker-dist + organize: + bottle-dist: docker/dist launchers: source: snap/local/launchers plugin: dump -- cgit v1.2.3 From 040528aab2102226cbd225acd04c51c0f8e7df32 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 7 Feb 2021 15:32:31 +0100 Subject: Glances version 3.1.6.2 --- NEWS.rst | 7 +++++++ docs/man/glances.1 | 2 +- glances/__init__.py | 2 +- glances/plugins/glances_diskio.py | 3 ++- glances/plugins/glances_network.py | 3 ++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index b0f33bc4..bb83c431 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -2,6 +2,13 @@ Glances Version 3 ============================================================================== +Version 3.1.6.2 +=============== + +Bugs corrected: + + * Remove bad merge for a non tested feature(see https://github.com/nicolargo/glances/issues/1787#issuecomment-774682954) + Version 3.1.6.1 =============== diff --git a/docs/man/glances.1 b/docs/man/glances.1 index a23fc394..ff3ca005 100644 --- a/docs/man/glances.1 +++ b/docs/man/glances.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GLANCES" "1" "Jan 24, 2021" "3.1.6.1" "Glances" +.TH "GLANCES" "1" "Feb 07, 2021" "3.1.6.2" "Glances" .SH NAME glances \- An eye on your system . diff --git a/glances/__init__.py b/glances/__init__.py index 1b3af1fd..89669479 100644 --- a/glances/__init__.py +++ b/glances/__init__.py @@ -29,7 +29,7 @@ import sys # Global name # Version should start and end with a numerical char # See https://packaging.python.org/specifications/core-metadata/#version -__version__ = '3.1.6.1' +__version__ = '3.1.6.2' __author__ = 'Nicolas Hennion ' __license__ = 'LGPLv3' diff --git a/glances/plugins/glances_diskio.py b/glances/plugins/glances_diskio.py index 3fe66543..9ac1e4ec 100644 --- a/glances/plugins/glances_diskio.py +++ b/glances/plugins/glances_diskio.py @@ -53,7 +53,8 @@ class Plugin(GlancesPlugin): # We want to display the stat in the curse interface self.display_curse = True # Hide stats if it has never been != 0 - self.hide_zero = True + self.hide_zero = config.get_bool_value( + self.plugin_name, 'hide_zero', default=False) self.hide_zero_fields = ['read_bytes', 'write_bytes'] def get_key(self): diff --git a/glances/plugins/glances_network.py b/glances/plugins/glances_network.py index 2adf3653..75e77c9d 100644 --- a/glances/plugins/glances_network.py +++ b/glances/plugins/glances_network.py @@ -62,7 +62,8 @@ class Plugin(GlancesPlugin): # We want to display the stat in the curse interface self.display_curse = True # Hide stats if it has never been != 0 - self.hide_zero = True + self.hide_zero = config.get_bool_value( + self.plugin_name, 'hide_zero', default=False) self.hide_zero_fields = ['rx', 'tx'] def get_key(self): -- cgit v1.2.3 From aea9942361b15e6c071bc05a6b07c13053e4086a Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 7 Feb 2021 16:15:29 +0100 Subject: Correct an issue if section did not exist --- glances/config.py | 10 +++++----- glances/plugins/glances_diskio.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/glances/config.py b/glances/config.py index e131ad7e..7ab8cfd6 100644 --- a/glances/config.py +++ b/glances/config.py @@ -25,7 +25,7 @@ import multiprocessing from io import open import re -from glances.compat import ConfigParser, NoOptionError, system_exec +from glances.compat import ConfigParser, NoOptionError, NoSectionError, system_exec from glances.globals import BSD, LINUX, MACOS, SUNOS, WINDOWS from glances.logger import logger @@ -295,7 +295,7 @@ class Config(object): ret = default try: ret = self.parser.get(section, option) - except NoOptionError: + except (NoOptionError, NoSectionError): pass # Search a substring `foo` and replace it by the result of its exec @@ -312,19 +312,19 @@ class Config(object): """Get the int value of an option, if it exists.""" try: return self.parser.getint(section, option) - except NoOptionError: + except (NoOptionError, NoSectionError): return int(default) def get_float_value(self, section, option, default=0.0): """Get the float value of an option, if it exists.""" try: return self.parser.getfloat(section, option) - except NoOptionError: + except (NoOptionError, NoSectionError): return float(default) def get_bool_value(self, section, option, default=True): """Get the bool value of an option, if it exists.""" try: return self.parser.getboolean(section, option) - except NoOptionError: + except (NoOptionError, NoSectionError): return bool(default) diff --git a/glances/plugins/glances_diskio.py b/glances/plugins/glances_diskio.py index 9ac1e4ec..952fa870 100644 --- a/glances/plugins/glances_diskio.py +++ b/glances/plugins/glances_diskio.py @@ -54,7 +54,7 @@ class Plugin(GlancesPlugin): self.display_curse = True # Hide stats if it has never been != 0 self.hide_zero = config.get_bool_value( - self.plugin_name, 'hide_zero', default=False) + self.plugin_name + 'XXX', 'hide_zero', default=False) self.hide_zero_fields = ['read_bytes', 'write_bytes'] def get_key(self): -- cgit v1.2.3