[Sugar-devel] [PATCH sugar] Use the same wording for the filesize of an entry without a file SL #2880

Simon Schampijer simon at schampijer.de
Thu Jun 30 04:18:31 EDT 2011


On 06/06/2011 11:25 AM, Simon Schampijer wrote:
> The change has no impact on existing translations, since
> we use as well util.format_size when no filesize is
> specified.
> ---
>   src/jarabe/journal/listmodel.py |    5 ++---
>   1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/jarabe/journal/listmodel.py b/src/jarabe/journal/listmodel.py
> index 3902eba..417ff61 100644
> --- a/src/jarabe/journal/listmodel.py
> +++ b/src/jarabe/journal/listmodel.py
> @@ -163,9 +163,8 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource):
>           try:
>               size = int(metadata.get('filesize'))
>           except (TypeError, ValueError):
> -            self._cached_row.append(_('Unknown'))
> -        else:
> -            self._cached_row.append(util.format_size(size))
> +            size = None
> +        self._cached_row.append(util.format_size(size))
>
>           try:
>               progress = int(float(metadata.get('progress', 100)))

Signed-off-by: Simon Schampijer <simon at laptop.org>
Tested-by: Samuel Greenfeld <greenfeld at laptop.org>

Gary, is that one ok with you? I slightly modified your initial patch. 
Sam did test it as working.

Regards,
    Simon


More information about the Sugar-devel mailing list