From 4b49e456dd2718bdc33e9d20ca2bcdb067a988f3 Mon Sep 17 00:00:00 2001 From: bendikro Date: Tue, 21 May 2013 18:36:21 +0200 Subject: [PATCH] Handle plugin info not available --- deluge/pluginmanagerbase.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deluge/pluginmanagerbase.py b/deluge/pluginmanagerbase.py index 49e5dada6..3e6a272ae 100644 --- a/deluge/pluginmanagerbase.py +++ b/deluge/pluginmanagerbase.py @@ -193,6 +193,12 @@ class PluginManagerBase: info = {}.fromkeys(METADATA_KEYS) last_header = "" cont_lines = [] + # Missing plugin info + if not self.pkg_env[name]: + log.warn("Failed to retrive info for plugin '%s'" % name) + for k in info: + info[k] = _("Not available") + return info for line in self.pkg_env[name][0].get_metadata("PKG-INFO").splitlines(): if not line: continue @@ -206,5 +212,4 @@ class PluginManagerBase: if line.split(":", 1)[0] in info.keys(): last_header = line.split(":", 1)[0] info[last_header] = line.split(":", 1)[1].strip() - return info