From a21f9e15c245df8becf31f0810f53f67518adb69 Mon Sep 17 00:00:00 2001 From: H4ckerxx44 Date: Sat, 13 Nov 2021 17:15:24 +0100 Subject: [PATCH] missing d in function name: is_disable() -> is_disabled() --- glances/outputs/glances_stdout_issue.py | 4 ++-- glances/plugins/glances_alert.py | 2 +- glances/plugins/glances_amps.py | 2 +- glances/plugins/glances_cloud.py | 2 +- glances/plugins/glances_connections.py | 2 +- glances/plugins/glances_cpu.py | 2 +- glances/plugins/glances_diskio.py | 2 +- glances/plugins/glances_docker.py | 2 +- glances/plugins/glances_folders.py | 2 +- glances/plugins/glances_fs.py | 2 +- glances/plugins/glances_gpu.py | 2 +- glances/plugins/glances_ip.py | 2 +- glances/plugins/glances_irq.py | 2 +- glances/plugins/glances_load.py | 2 +- glances/plugins/glances_mem.py | 2 +- glances/plugins/glances_memswap.py | 2 +- glances/plugins/glances_network.py | 2 +- glances/plugins/glances_percpu.py | 6 +++--- glances/plugins/glances_plugin.py | 2 +- glances/plugins/glances_quicklook.py | 2 +- glances/plugins/glances_raid.py | 2 +- glances/plugins/glances_sensors.py | 2 +- glances/plugins/glances_smart.py | 2 +- glances/plugins/glances_wifi.py | 2 +- glances/stats_client_snmp.py | 2 +- 25 files changed, 28 insertions(+), 28 deletions(-) diff --git a/glances/outputs/glances_stdout_issue.py b/glances/outputs/glances_stdout_issue.py index 854476ae..c8676e4a 100644 --- a/glances/outputs/glances_stdout_issue.py +++ b/glances/outputs/glances_stdout_issue.py @@ -94,7 +94,7 @@ class GlancesStdoutIssue(object): self.print_version() for plugin in sorted(stats._plugins): - if stats._plugins[plugin].is_disable(): + if stats._plugins[plugin].is_disabled(): continue try: # Update the stats @@ -105,7 +105,7 @@ class GlancesStdoutIssue(object): time.sleep(3) for plugin in sorted(stats._plugins): - if stats._plugins[plugin].is_disable(): + if stats._plugins[plugin].is_disabled(): # If current plugin is disable # then continue to next plugin result = colors.NO + '[N/A]'.rjust(19 - len(plugin)) diff --git a/glances/plugins/glances_alert.py b/glances/plugins/glances_alert.py index cd558049..bd6d3961 100644 --- a/glances/plugins/glances_alert.py +++ b/glances/plugins/glances_alert.py @@ -210,7 +210,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if display plugin enable... - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # Build the string message diff --git a/glances/plugins/glances_amps.py b/glances/plugins/glances_amps.py index ff719297..a4af1dc3 100644 --- a/glances/plugins/glances_amps.py +++ b/glances/plugins/glances_amps.py @@ -98,7 +98,7 @@ class Plugin(GlancesPlugin): # Only process if stats exist and display plugin enable... ret = [] - if not self.stats or args.disable_process or self.is_disable(): + if not self.stats or args.disable_process or self.is_disabled(): return ret # Build the string message diff --git a/glances/plugins/glances_cloud.py b/glances/plugins/glances_cloud.py index 202c62ca..bed9186b 100644 --- a/glances/plugins/glances_cloud.py +++ b/glances/plugins/glances_cloud.py @@ -107,7 +107,7 @@ class Plugin(GlancesPlugin): # Init the return message ret = [] - if not self.stats or self.stats == {} or self.is_disable(): + if not self.stats or self.stats == {} or self.is_disabled(): return ret # Generate the output diff --git a/glances/plugins/glances_connections.py b/glances/plugins/glances_connections.py index 16b2239c..5aefdf00 100644 --- a/glances/plugins/glances_connections.py +++ b/glances/plugins/glances_connections.py @@ -146,7 +146,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and display plugin enable... - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # Header diff --git a/glances/plugins/glances_cpu.py b/glances/plugins/glances_cpu.py index 16c878af..f8412d95 100644 --- a/glances/plugins/glances_cpu.py +++ b/glances/plugins/glances_cpu.py @@ -279,7 +279,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and plugin not disable - if not self.stats or self.args.percpu or self.is_disable(): + if not self.stats or self.args.percpu or self.is_disabled(): return ret # If user stat is not here, display only idle / total CPU usage (for diff --git a/glances/plugins/glances_diskio.py b/glances/plugins/glances_diskio.py index 29365e63..ec6c016e 100644 --- a/glances/plugins/glances_diskio.py +++ b/glances/plugins/glances_diskio.py @@ -177,7 +177,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and display plugin enable... - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # Max size for the interface name diff --git a/glances/plugins/glances_docker.py b/glances/plugins/glances_docker.py index ed56b49b..4a74802a 100644 --- a/glances/plugins/glances_docker.py +++ b/glances/plugins/glances_docker.py @@ -570,7 +570,7 @@ class Plugin(GlancesPlugin): # Only process if stats exist (and non null) and display plugin enable... if not self.stats \ or 'containers' not in self.stats or len(self.stats['containers']) == 0 \ - or self.is_disable(): + or self.is_disabled(): return ret # Build the string message diff --git a/glances/plugins/glances_folders.py b/glances/plugins/glances_folders.py index 8efddadc..cd1a6d4e 100644 --- a/glances/plugins/glances_folders.py +++ b/glances/plugins/glances_folders.py @@ -112,7 +112,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and display plugin enable... - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # Max size for the interface name diff --git a/glances/plugins/glances_fs.py b/glances/plugins/glances_fs.py index d1cc313f..1be8c873 100644 --- a/glances/plugins/glances_fs.py +++ b/glances/plugins/glances_fs.py @@ -205,7 +205,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and display plugin enable... - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # Max size for the interface name diff --git a/glances/plugins/glances_gpu.py b/glances/plugins/glances_gpu.py index dbfff387..d7b03eed 100644 --- a/glances/plugins/glances_gpu.py +++ b/glances/plugins/glances_gpu.py @@ -166,7 +166,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist, not empty (issue #871) and plugin not disabled - if not self.stats or (self.stats == []) or self.is_disable(): + if not self.stats or (self.stats == []) or self.is_disabled(): return ret # Check if all GPU have the same name diff --git a/glances/plugins/glances_ip.py b/glances/plugins/glances_ip.py index a4aae49f..6deae75a 100644 --- a/glances/plugins/glances_ip.py +++ b/glances/plugins/glances_ip.py @@ -114,7 +114,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and display plugin enable... - if not self.stats or self.is_disable() or import_error_tag: + if not self.stats or self.is_disabled() or import_error_tag: return ret # Build the string message diff --git a/glances/plugins/glances_irq.py b/glances/plugins/glances_irq.py index 7f666df7..ce8010fd 100644 --- a/glances/plugins/glances_irq.py +++ b/glances/plugins/glances_irq.py @@ -90,7 +90,7 @@ class Plugin(GlancesPlugin): # Only available on GNU/Linux # Only process if stats exist and display plugin enable... - if not LINUX or not self.stats or self.is_disable(): + if not LINUX or not self.stats or self.is_disabled(): return ret # Max size for the interface name diff --git a/glances/plugins/glances_load.py b/glances/plugins/glances_load.py index bc602e66..18cf18eb 100644 --- a/glances/plugins/glances_load.py +++ b/glances/plugins/glances_load.py @@ -160,7 +160,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist, not empty (issue #871) and plugin not disabled - if not self.stats or (self.stats == {}) or self.is_disable(): + if not self.stats or (self.stats == {}) or self.is_disabled(): return ret # Build the string message diff --git a/glances/plugins/glances_mem.py b/glances/plugins/glances_mem.py index 07690f1d..40636739 100644 --- a/glances/plugins/glances_mem.py +++ b/glances/plugins/glances_mem.py @@ -221,7 +221,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and plugin not disabled - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # First line diff --git a/glances/plugins/glances_memswap.py b/glances/plugins/glances_memswap.py index 525bbe51..2b307615 100644 --- a/glances/plugins/glances_memswap.py +++ b/glances/plugins/glances_memswap.py @@ -177,7 +177,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and plugin not disabled - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # First line diff --git a/glances/plugins/glances_network.py b/glances/plugins/glances_network.py index 46d19261..c0828529 100644 --- a/glances/plugins/glances_network.py +++ b/glances/plugins/glances_network.py @@ -301,7 +301,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and display plugin enable... - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # Max size for the interface name diff --git a/glances/plugins/glances_percpu.py b/glances/plugins/glances_percpu.py index f16fb9e3..0e81b89f 100644 --- a/glances/plugins/glances_percpu.py +++ b/glances/plugins/glances_percpu.py @@ -78,11 +78,11 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist... - if not self.stats or not self.args.percpu or self.is_disable(): + if not self.stats or not self.args.percpu or self.is_disabled(): return ret # Build the string message - if self.is_disable('quicklook'): + if self.is_disabled('quicklook'): msg = '{:7}'.format('PER CPU') ret.append(self.curse_add_line(msg, "TITLE")) @@ -96,7 +96,7 @@ class Plugin(GlancesPlugin): # Per CPU stats displayed per column for cpu in self.stats: ret.append(self.curse_new_line()) - if self.is_disable('quicklook'): + if self.is_disabled('quicklook'): try: msg = '{:6.1f}%'.format(cpu['total']) except TypeError: diff --git a/glances/plugins/glances_plugin.py b/glances/plugins/glances_plugin.py index 84eb3a70..c50f7eef 100644 --- a/glances/plugins/glances_plugin.py +++ b/glances/plugins/glances_plugin.py @@ -173,7 +173,7 @@ class GlancesPlugin(object): d = getattr(self.args, 'enable_' + plugin_name, True) return d is False - def is_disable(self, plugin_name=None): + def is_disabled(self, plugin_name=None): """Return true if plugin is disabled.""" return not self.is_enable(plugin_name=plugin_name) diff --git a/glances/plugins/glances_quicklook.py b/glances/plugins/glances_quicklook.py index 067bd7ca..900ff624 100644 --- a/glances/plugins/glances_quicklook.py +++ b/glances/plugins/glances_quicklook.py @@ -111,7 +111,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist... - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # Define the data: Bar (default behavor) or Sparkline diff --git a/glances/plugins/glances_raid.py b/glances/plugins/glances_raid.py index 795812e7..c5e9c68f 100644 --- a/glances/plugins/glances_raid.py +++ b/glances/plugins/glances_raid.py @@ -83,7 +83,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist... - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # Max size for the interface name diff --git a/glances/plugins/glances_sensors.py b/glances/plugins/glances_sensors.py index 017cbda1..f8afcb41 100644 --- a/glances/plugins/glances_sensors.py +++ b/glances/plugins/glances_sensors.py @@ -201,7 +201,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and display plugin enable... - if not self.stats or self.is_disable(): + if not self.stats or self.is_disabled(): return ret # Max size for the interface name diff --git a/glances/plugins/glances_smart.py b/glances/plugins/glances_smart.py index 29f8d087..5e04a44a 100644 --- a/glances/plugins/glances_smart.py +++ b/glances/plugins/glances_smart.py @@ -180,7 +180,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist... - if import_error_tag or not self.stats or self.is_disable(): + if import_error_tag or not self.stats or self.is_disabled(): return ret # Max size for the interface name diff --git a/glances/plugins/glances_wifi.py b/glances/plugins/glances_wifi.py index 219f4d2e..13a5da77 100644 --- a/glances/plugins/glances_wifi.py +++ b/glances/plugins/glances_wifi.py @@ -168,7 +168,7 @@ class Plugin(GlancesPlugin): ret = [] # Only process if stats exist and display plugin enable... - if not self.stats or import_error_tag or self.is_disable(): + if not self.stats or import_error_tag or self.is_disabled(): return ret # Max size for the interface name diff --git a/glances/stats_client_snmp.py b/glances/stats_client_snmp.py index 30acd9a8..2f80d567 100644 --- a/glances/stats_client_snmp.py +++ b/glances/stats_client_snmp.py @@ -100,7 +100,7 @@ class GlancesStatsClientSNMP(GlancesStats): """Update the stats using SNMP.""" # For each plugins, call the update method for p in self._plugins: - if self._plugins[p].is_disable(): + if self._plugins[p].is_disabled(): # If current plugin is disable # then continue to next plugin continue