diff options
Diffstat (limited to 'glances/plugins/plugin/model.py')
-rw-r--r-- | glances/plugins/plugin/model.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/glances/plugins/plugin/model.py b/glances/plugins/plugin/model.py index 8857fd11..afc0b0ad 100644 --- a/glances/plugins/plugin/model.py +++ b/glances/plugins/plugin/model.py @@ -129,7 +129,7 @@ class GlancesPluginModel(object): def __repr__(self): """Return the raw stats.""" - return self.stats + return str(self.stats) def __str__(self): """Return the human-readable stats.""" @@ -301,6 +301,8 @@ class GlancesPluginModel(object): def sorted_stats(self): """Get the stats sorted by an alias (if present) or key.""" key = self.get_key() + if key is None: + return self.stats try: return sorted( self.stats, @@ -551,6 +553,10 @@ class GlancesPluginModel(object): """Set the views to input_views.""" self.views = input_views + def reset_views(self): + """Reset the views to input_views.""" + self.views = dict() + def get_views(self, item=None, key=None, option=None): """Return the views object. |