[Sugar-devel] [PATCH sugar] Journal list view: don't choke on invalid or incomplete metadata (SL#1408)

Sascha Silbe sascha-ml-reply-to-2010-3 at silbe.org
Tue Nov 30 05:54:11 EST 2010


Excerpts from Simon Schampijer's message of Mon Nov 29 14:40:47 +0100 2010:

> Acked-by: Simon Schampijer <simon at schampijer.de>

Pushed as 79c85ed (master) / 5fdb4f3 (sucrose-0.90), thanks!


> > +        try:
> > +            progress = int(float(metadata.get('progress', 100)))
> > +        except (TypeError, ValueError):
> > +            progress = 100
> > +        self._cached_row.append(progress)
> 
> I think it is ok, to not log here an error indeed. The int(float) cast 
> first looked strange, but is ok here. Side-note: Actually, do we need to 
> store the progress in float...?

Browse doesn't store it as float, but since any activity might add a
progress value, we should be liberal in what we accept.

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: 490 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20101130/96b45455/attachment.pgp>


More information about the Sugar-devel mailing list