From f5ad01a86500e4a1763ca5b04b7f0a25902cc14b Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 21 Nov 2008 09:15:05 +0000 Subject: [PATCH] Add 'get_session_status' to core --- deluge/core/core.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/deluge/core/core.py b/deluge/core/core.py index 63bf890f9..6064ef85f 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -396,6 +396,22 @@ class Core( } + def export_get_session_status(self, keys): + """ + Gets the session status values for 'keys' + + :param keys: list of strings, the keys for which we want values + :returns: a dictionary of {key: value, ...} + :rtype: dict + + """ + status = {} + session_status = self.session.status() + for key in keys: + status[key] = getattr(session_status, key) + + return status + def export_add_torrent_url(self, url, options): log.info("Attempting to add url %s", url)