mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-21 00:01:53 +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()
|
self.print_version()
|
||||||
|
|
||||||
for plugin in sorted(stats._plugins):
|
for plugin in sorted(stats._plugins):
|
||||||
if stats._plugins[plugin].is_disable():
|
if stats._plugins[plugin].is_disabled():
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
# Update the stats
|
# Update the stats
|
||||||
@ -105,7 +105,7 @@ class GlancesStdoutIssue(object):
|
|||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
for plugin in sorted(stats._plugins):
|
for plugin in sorted(stats._plugins):
|
||||||
if stats._plugins[plugin].is_disable():
|
if stats._plugins[plugin].is_disabled():
|
||||||
# If current plugin is disable
|
# If current plugin is disable
|
||||||
# then continue to next plugin
|
# then continue to next plugin
|
||||||
result = colors.NO + '[N/A]'.rjust(19 - len(plugin))
|
result = colors.NO + '[N/A]'.rjust(19 - len(plugin))
|
||||||
|
@ -210,7 +210,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if display plugin enable...
|
# Only process if display plugin enable...
|
||||||
if not self.stats or self.is_disable():
|
if not self.stats or self.is_disabled():
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
# Build the string message
|
# Build the string message
|
||||||
|
@ -98,7 +98,7 @@ class Plugin(GlancesPlugin):
|
|||||||
# Only process if stats exist and display plugin enable...
|
# Only process if stats exist and display plugin enable...
|
||||||
ret = []
|
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
|
return ret
|
||||||
|
|
||||||
# Build the string message
|
# Build the string message
|
||||||
|
@ -107,7 +107,7 @@ class Plugin(GlancesPlugin):
|
|||||||
# Init the return message
|
# Init the return message
|
||||||
ret = []
|
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
|
return ret
|
||||||
|
|
||||||
# Generate the output
|
# Generate the output
|
||||||
|
@ -146,7 +146,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and display plugin enable...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
|
@ -279,7 +279,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and plugin not disable
|
# 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
|
return ret
|
||||||
|
|
||||||
# If user stat is not here, display only idle / total CPU usage (for
|
# If user stat is not here, display only idle / total CPU usage (for
|
||||||
|
@ -177,7 +177,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and display plugin enable...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Max size for the interface name
|
# 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...
|
# Only process if stats exist (and non null) and display plugin enable...
|
||||||
if not self.stats \
|
if not self.stats \
|
||||||
or 'containers' not in self.stats or len(self.stats['containers']) == 0 \
|
or 'containers' not in self.stats or len(self.stats['containers']) == 0 \
|
||||||
or self.is_disable():
|
or self.is_disabled():
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
# Build the string message
|
# Build the string message
|
||||||
|
@ -112,7 +112,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and display plugin enable...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Max size for the interface name
|
# Max size for the interface name
|
||||||
|
@ -205,7 +205,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and display plugin enable...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Max size for the interface name
|
# Max size for the interface name
|
||||||
|
@ -166,7 +166,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist, not empty (issue #871) and plugin not disabled
|
# 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
|
return ret
|
||||||
|
|
||||||
# Check if all GPU have the same name
|
# Check if all GPU have the same name
|
||||||
|
@ -114,7 +114,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and display plugin enable...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Build the string message
|
# Build the string message
|
||||||
|
@ -90,7 +90,7 @@ class Plugin(GlancesPlugin):
|
|||||||
|
|
||||||
# Only available on GNU/Linux
|
# Only available on GNU/Linux
|
||||||
# Only process if stats exist and display plugin enable...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Max size for the interface name
|
# Max size for the interface name
|
||||||
|
@ -160,7 +160,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist, not empty (issue #871) and plugin not disabled
|
# 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
|
return ret
|
||||||
|
|
||||||
# Build the string message
|
# Build the string message
|
||||||
|
@ -221,7 +221,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and plugin not disabled
|
# 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
|
return ret
|
||||||
|
|
||||||
# First line
|
# First line
|
||||||
|
@ -177,7 +177,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and plugin not disabled
|
# 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
|
return ret
|
||||||
|
|
||||||
# First line
|
# First line
|
||||||
|
@ -301,7 +301,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and display plugin enable...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Max size for the interface name
|
# Max size for the interface name
|
||||||
|
@ -78,11 +78,11 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Build the string message
|
# Build the string message
|
||||||
if self.is_disable('quicklook'):
|
if self.is_disabled('quicklook'):
|
||||||
msg = '{:7}'.format('PER CPU')
|
msg = '{:7}'.format('PER CPU')
|
||||||
ret.append(self.curse_add_line(msg, "TITLE"))
|
ret.append(self.curse_add_line(msg, "TITLE"))
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ class Plugin(GlancesPlugin):
|
|||||||
# Per CPU stats displayed per column
|
# Per CPU stats displayed per column
|
||||||
for cpu in self.stats:
|
for cpu in self.stats:
|
||||||
ret.append(self.curse_new_line())
|
ret.append(self.curse_new_line())
|
||||||
if self.is_disable('quicklook'):
|
if self.is_disabled('quicklook'):
|
||||||
try:
|
try:
|
||||||
msg = '{:6.1f}%'.format(cpu['total'])
|
msg = '{:6.1f}%'.format(cpu['total'])
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
@ -173,7 +173,7 @@ class GlancesPlugin(object):
|
|||||||
d = getattr(self.args, 'enable_' + plugin_name, True)
|
d = getattr(self.args, 'enable_' + plugin_name, True)
|
||||||
return d is False
|
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 true if plugin is disabled."""
|
||||||
return not self.is_enable(plugin_name=plugin_name)
|
return not self.is_enable(plugin_name=plugin_name)
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist...
|
# Only process if stats exist...
|
||||||
if not self.stats or self.is_disable():
|
if not self.stats or self.is_disabled():
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
# Define the data: Bar (default behavor) or Sparkline
|
# Define the data: Bar (default behavor) or Sparkline
|
||||||
|
@ -83,7 +83,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist...
|
# Only process if stats exist...
|
||||||
if not self.stats or self.is_disable():
|
if not self.stats or self.is_disabled():
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
# Max size for the interface name
|
# Max size for the interface name
|
||||||
|
@ -201,7 +201,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and display plugin enable...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Max size for the interface name
|
# Max size for the interface name
|
||||||
|
@ -180,7 +180,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Max size for the interface name
|
# Max size for the interface name
|
||||||
|
@ -168,7 +168,7 @@ class Plugin(GlancesPlugin):
|
|||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
# Only process if stats exist and display plugin enable...
|
# 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
|
return ret
|
||||||
|
|
||||||
# Max size for the interface name
|
# Max size for the interface name
|
||||||
|
@ -100,7 +100,7 @@ class GlancesStatsClientSNMP(GlancesStats):
|
|||||||
"""Update the stats using SNMP."""
|
"""Update the stats using SNMP."""
|
||||||
# For each plugins, call the update method
|
# For each plugins, call the update method
|
||||||
for p in self._plugins:
|
for p in self._plugins:
|
||||||
if self._plugins[p].is_disable():
|
if self._plugins[p].is_disabled():
|
||||||
# If current plugin is disable
|
# If current plugin is disable
|
||||||
# then continue to next plugin
|
# then continue to next plugin
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user