mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-20 15:52:16 +03:00
missing d in function name:
is_disable() -> is_disabled()
This commit is contained in:
parent
2ccfae0779
commit
a21f9e15c2
@ -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))
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user