summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbendikro <bendikro@gmail.com>2013-05-21 18:36:21 +0200
committerCalum Lind <calumlind+deluge@gmail.com>2013-05-22 23:26:30 +0100
commit27bfa5a64933a46cb3b6edc73d64fd401953ea09 (patch)
tree11162c92d1f0df42ab95b02f413b569481e72c14
parent5057e2caab9957e8119e3e1a4a0ce83126caef29 (diff)
downloaddeluge-27bfa5a6493.zip
deluge-27bfa5a6493.tar.gz
deluge-27bfa5a6493.tar.bz2
Fix #2302 : deluge-gtk crashed with IndexError in get_plugin_info
This fix handles the plugin info not being available
-rw-r--r--deluge/pluginmanagerbase.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/deluge/pluginmanagerbase.py b/deluge/pluginmanagerbase.py
index da46449..c34b9d3 100644
--- a/deluge/pluginmanagerbase.py
+++ b/deluge/pluginmanagerbase.py
@@ -174,6 +174,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
@@ -187,5 +193,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