mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 05:47:50 +00:00
Handle plugin info not available
This commit is contained in:
parent
e2e09200c4
commit
4b49e456dd
@ -193,6 +193,12 @@ class PluginManagerBase:
|
|||||||
info = {}.fromkeys(METADATA_KEYS)
|
info = {}.fromkeys(METADATA_KEYS)
|
||||||
last_header = ""
|
last_header = ""
|
||||||
cont_lines = []
|
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():
|
for line in self.pkg_env[name][0].get_metadata("PKG-INFO").splitlines():
|
||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
@ -206,5 +212,4 @@ class PluginManagerBase:
|
|||||||
if line.split(":", 1)[0] in info.keys():
|
if line.split(":", 1)[0] in info.keys():
|
||||||
last_header = line.split(":", 1)[0]
|
last_header = line.split(":", 1)[0]
|
||||||
info[last_header] = line.split(":", 1)[1].strip()
|
info[last_header] = line.split(":", 1)[1].strip()
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user