From d1b8075fe6822b966faccb9d0eb547af97fabe76 Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Mon, 25 Feb 2008 17:44:32 +0000 Subject: [PATCH] webui:torrent_list:use sclient.get_torrents_status instead of async --- .../webui/webui_plugin/templates/deluge/config.html | 3 --- deluge/ui/webui/webui_plugin/utils.py | 12 +++++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/deluge/ui/webui/webui_plugin/templates/deluge/config.html b/deluge/ui/webui/webui_plugin/templates/deluge/config.html index 4ee2d75cc..cbc35956e 100644 --- a/deluge/ui/webui/webui_plugin/templates/deluge/config.html +++ b/deluge/ui/webui/webui_plugin/templates/deluge/config.html @@ -14,7 +14,6 @@ $for group in groups: $else:
  • $pages[page].title
  • -
    @@ -31,8 +30,6 @@ $if error: - -
    diff --git a/deluge/ui/webui/webui_plugin/utils.py b/deluge/ui/webui/webui_plugin/utils.py index ac2e43866..adac995c7 100644 --- a/deluge/ui/webui/webui_plugin/utils.py +++ b/deluge/ui/webui/webui_plugin/utils.py @@ -232,14 +232,12 @@ def get_torrent_status(torrent_id): def get_torrent_list(): """ - uses async. + returns a list of storified-torrent-dicts. """ - torrent_ids = proxy.get_session_state() #Syc-api. - torrent_dict = {} - for id in torrent_ids: - async_proxy.get_torrent_status(dict_cb(id,torrent_dict), id, - TORRENT_KEYS) - async_proxy.force_call(block=True) + torrent_ids = proxy.get_session_state() + + torrent_dict = proxy.get_torrents_status(torrent_ids, TORRENT_KEYS) + return [enhance_torrent_status(id, status) for id, status in torrent_dict.iteritems()]