[Dextrose] [PATCH 1/5][dextrose2][sugar] Updater show error at checking failure

Sascha Silbe sascha-ml-reply-to-2011-2 at silbe.org
Wed Apr 20 02:59:51 EDT 2011


Excerpts from Martin Abente's message of Tue Apr 19 23:21:24 +0200 2011:

[extensions/cpsection/updater/backends/microformat.py]
> @@ -183,7 +184,8 @@ class _UpdateFetcher(gobject.GObject):
>          try:
>              stream = gfile.read_finish(result)
>          except:
> -            self._completion_cb({}, traceback.format_exc())
> +            logging.debug(traceback.format_exc())

Unless you are sure you don't want to log the exact error message during
normal operation (think twice), you could use logging.exception()
instead. E.g.:

            logging.exception('Failed to download bundle:')


[extensions/cpsection/updater/view.py]
> @@ -132,6 +135,11 @@ class ActivityUpdater(SectionView):
[...]
> +    def _failed_at_checking(self):
> +        top_message = _('Update service is not available')
> +        self._top_label.set_markup('<big>%s</big>' % top_message)

You might want to escape top_message using gobject.markup_escape_text()
before you pass it into set_markup(). We don't pass in any data from
external sources, but I wouldn't rely on translators not to pass in
characters that might be interpreted specially by GTK (<, >, &, etc.).
Or to put it another way: Translators should not have to care about
avoiding certain characters.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 500 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/dextrose/attachments/20110420/a5e17b88/attachment.pgp>


More information about the Dextrose mailing list