def _gio_screenshots_json_download_complete_cb(self, source, result, path):
try:
res, content, etag = source.load_contents_finish(result)
except GObject.GError:
# ignore read errors, most likely transient
return
if content is not None:
try:
content = json.loads(content)
except ValueError as e:
LOG.error("can not decode: '%s' (%s)" % (content, e))
content = None
if isinstance(content, dict):
# a list of screenshots as listsed online
screenshot_list = content['screenshots']
else:
# fallback to a list of screenshots as supplied by the axi
screenshot_list = []
# save for later and emit
self._screenshot_list = self._sort_screenshots_by_best_version(
screenshot_list)
self.emit("screenshots-available", self._screenshot_list)
评论列表
文章目录