[processing] Fixes #11345 - Python error while using Get script from online scripts collection

This commit is contained in:
Salvatore Larosa 2014-10-07 22:26:58 +02:00
parent 17ca96fd26
commit dcdf9fb7f6
2 changed files with 4 additions and 4 deletions

View File

@ -159,9 +159,9 @@ class GetScriptsAndModelsDialog(QDialog, Ui_DlgGetScriptsAndModels):
helpContent = readUrl(url)
descriptions = json.loads(helpContent)
html = '<h2>%s</h2>' % item.name
html += self.tr('<p><b>Description:</b>%s</p>') % getDescription(ALG_DESC, descriptions)
html += self.tr('<p><b>Created by:</b>%s') % getDescription(ALG_CREATOR, descriptions)
html += self.tr('<p><b>Version:</b>%s') % getDescription(ALG_VERSION, descriptions)
html += self.tr('<p><b>Description:</b> %s</p>') % getDescription(ALG_DESC, descriptions)
html += self.tr('<p><b>Created by:</b> %s') % getDescription(ALG_CREATOR, descriptions)
html += self.tr('<p><b>Version:</b> %s') % getDescription(ALG_VERSION, descriptions)
except HTTPError, e:
html = self.tr('<h2>No detailed description available for this script</h2>')
self.webView.setHtml(html)

View File

@ -88,7 +88,7 @@ def getHtmlFromDescriptionsDict(alg, descriptions):
def getDescription(name, descriptions):
if name in descriptions:
return descriptions[name].replace("\n", "<br>")
return unicode(descriptions[name]).replace("\n", "<br>")
else:
return ''