mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
merge the stats from status into the stats dict (allows additional stats
to be added more easily)
This commit is contained in:
parent
41d955a5ea
commit
6cd0ab30a5
1 changed files with 5 additions and 3 deletions
|
@ -97,12 +97,14 @@ class Core(CorePluginBase):
|
||||||
try:
|
try:
|
||||||
stats = self.core.export_get_stats()
|
stats = self.core.export_get_stats()
|
||||||
status = self.core.session.status()
|
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():
|
for stat, stat_list in self.saved_stats.iteritems():
|
||||||
if stat in stats:
|
if stat in stats:
|
||||||
stat_list.insert(0, int(stats[stat]))
|
stat_list.insert(0, int(stats[stat]))
|
||||||
else:
|
|
||||||
stat_list.insert(0, int(getattr(status, stat)))
|
|
||||||
if len(stat_list) > self.length:
|
if len(stat_list) > self.length:
|
||||||
stat_list.pop()
|
stat_list.pop()
|
||||||
except Exception,e:
|
except Exception,e:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue