[processing] python3/pyqt5 fixes for get scripts and models dialog

This commit is contained in:
nirvn 2016-11-24 12:58:07 +07:00 committed by Matthias Kuhn
parent 7e0cd9af3d
commit ac721d3344

View File

@ -194,8 +194,8 @@ class GetScriptsAndModelsDialog(BASE, WIDGET):
if reply.error() != QNetworkReply.NoError: if reply.error() != QNetworkReply.NoError:
self.popupError(reply.error(), reply.request().url().toString()) self.popupError(reply.error(), reply.request().url().toString())
else: else:
resources = str(reply.readAll()).splitlines() resources = bytes(reply.readAll()).decode('utf8').splitlines()
resources = [r.split(',') for r in resources] resources = [r.split(',', 2) for r in resources]
self.resources = {f: (v, n) for f, v, n in resources} self.resources = {f: (v, n) for f, v, n in resources}
reply.deleteLater() reply.deleteLater()
@ -242,7 +242,7 @@ class GetScriptsAndModelsDialog(BASE, WIDGET):
if reply.error() != QNetworkReply.NoError: if reply.error() != QNetworkReply.NoError:
html = self.tr('<h2>No detailed description available for this script</h2>') html = self.tr('<h2>No detailed description available for this script</h2>')
else: else:
content = str(reply.readAll()) content = bytes(reply.readAll()).decode('utf8')
descriptions = json.loads(content) descriptions = json.loads(content)
html = '<h2>%s</h2>' % item.name html = '<h2>%s</h2>' % item.name
html += self.tr('<p><b>Description:</b> %s</p>') % getDescription(ALG_DESC, descriptions) html += self.tr('<p><b>Description:</b> %s</p>') % getDescription(ALG_DESC, descriptions)
@ -287,7 +287,7 @@ class GetScriptsAndModelsDialog(BASE, WIDGET):
self.popupError(reply.error(), reply.request().url().toString()) self.popupError(reply.error(), reply.request().url().toString())
content = None content = None
else: else:
content = reply.readAll() content = bytes(reply.readAll()).decode('utf8')
reply.deleteLater() reply.deleteLater()
if content: if content: