From 6cd0ab30a518e03a66e0f20aa6ea86a062739c96 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Sat, 4 Oct 2008 10:10:49 +0000 Subject: [PATCH] merge the stats from status into the stats dict (allows additional stats to be added more easily) --- deluge/plugins/graph/graph/core.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/deluge/plugins/graph/graph/core.py b/deluge/plugins/graph/graph/core.py index 72e64cc37..dd175a579 100644 --- a/deluge/plugins/graph/graph/core.py +++ b/deluge/plugins/graph/graph/core.py @@ -97,12 +97,14 @@ class Core(CorePluginBase): try: stats = self.core.export_get_stats() status = self.core.session.status() - #log.debug(dir(status)) + for stat in dir(status): + if not stat.startswith('_') and stat not in stats: + stats[stat] = getattr(status, stat, None) + for stat, stat_list in self.saved_stats.iteritems(): if stat in stats: stat_list.insert(0, int(stats[stat])) - else: - stat_list.insert(0, int(getattr(status, stat))) + if len(stat_list) > self.length: stat_list.pop() except Exception,e: