def _on_gwibber_fail(self, api, trans, failed_accounts, error):
self._change_status("fail", _("Problems posting to Gwibber"))
#list to hold service strings in the format: "Service (@username)"
failed_services = []
for account in failed_accounts:
failed_services.append("%s (@%s)" % (
account['service'].capitalize(), account['username']))
glade_dialog = SimpleGtkbuilderDialog(self.datadir,
domain="software-center")
dialog = glade_dialog.dialog_gwibber_error
dialog.set_transient_for(self.submit_window)
# build the failure string
# TRANSLATORS: the part in %s can either be a single entry
# like "facebook" or a string like
# "factbook and twister"
error_str = gettext.ngettext(
"There was a problem posting this review to %s.",
"There was a problem posting this review to %s.",
len(failed_services))
error_str = make_string_from_list(error_str, failed_services)
dialog.set_markup(error_str)
dialog.format_secondary_text(error)
result = dialog.run()
dialog.destroy()
if result == Gtk.RESPONSE_ACCEPT:
self._gwibber_retry_some(api, trans, failed_accounts)
else:
BaseApp.on_transmit_success(self, api, trans)
评论列表
文章目录