missing d in function name:

is_enable() -> is_enabled()
pull/1949/head
H4ckerxx44 2021-11-13 17:15:57 +01:00
parent a21f9e15c2
commit 760c26fb6e
4 changed files with 6 additions and 6 deletions

View File

@ -63,7 +63,7 @@ class GlancesStdout(object):
for plugin, attribute in self.plugins_list: for plugin, attribute in self.plugins_list:
# Check if the plugin exist and is enable # Check if the plugin exist and is enable
if plugin in stats.getPluginsList() and \ if plugin in stats.getPluginsList() and \
stats.get_plugin(plugin).is_enable(): stats.get_plugin(plugin).is_enabled():
stat = stats.get_plugin(plugin).get_export() stat = stats.get_plugin(plugin).get_export()
else: else:
continue continue

View File

@ -117,7 +117,7 @@ class GlancesStdoutCsv(object):
for plugin, attribute in self.plugins_list: for plugin, attribute in self.plugins_list:
# Check if the plugin exist and is enable # Check if the plugin exist and is enable
if plugin in stats.getPluginsList() and \ if plugin in stats.getPluginsList() and \
stats.get_plugin(plugin).is_enable(): stats.get_plugin(plugin).is_enabled():
stat = stats.get_plugin(plugin).get_export() stat = stats.get_plugin(plugin).get_export()
else: else:
continue continue

View File

@ -163,7 +163,7 @@ class GlancesPlugin(object):
"""Return the key of the list.""" """Return the key of the list."""
return None return None
def is_enable(self, plugin_name=None): def is_enabled(self, plugin_name=None):
"""Return true if plugin is enabled.""" """Return true if plugin is enabled."""
if not plugin_name: if not plugin_name:
plugin_name = self.plugin_name plugin_name = self.plugin_name
@ -175,7 +175,7 @@ class GlancesPlugin(object):
def is_disabled(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_enabled(plugin_name=plugin_name)
def _json_dumps(self, d): def _json_dumps(self, d):
"""Return the object 'd' in a JSON format. """Return the object 'd' in a JSON format.
@ -1146,7 +1146,7 @@ class GlancesPlugin(object):
""" """
def wrapper(self, *args, **kw): def wrapper(self, *args, **kw):
if self.is_enable() and (self.refresh_timer.finished() or self.stats == self.get_init_value): if self.is_enabled() and (self.refresh_timer.finished() or self.stats == self.get_init_value):
# Run the method # Run the method
ret = fct(self, *args, **kw) ret = fct(self, *args, **kw)
# Reset the timer # Reset the timer

View File

@ -51,7 +51,7 @@ class GlancesStatsServer(GlancesStats):
def _set_stats(self, input_stats): def _set_stats(self, input_stats):
"""Set the stats to the input_stats one.""" """Set the stats to the input_stats one."""
# Build the all_stats with the get_raw() method of the plugins # Build the all_stats with the get_raw() method of the plugins
return {p: self._plugins[p].get_raw() for p in self._plugins if self._plugins[p].is_enable()} return {p: self._plugins[p].get_raw() for p in self._plugins if self._plugins[p].is_enabled()}
def getAll(self): def getAll(self):
"""Return the stats as a list.""" """Return the stats as a list."""