[Dextrose] [PATCH sugar] Journal: display entries that have no title on storage devices #10533

Anish Mangal anishmangal2002 at gmail.com
Mon Feb 14 22:42:15 EST 2011


Just reconfirming. This _is_ intended for dextrose/mainline?

On Thu, Feb 3, 2011 at 20:56, Aleksey Lim <alsroot at member.fsf.org> wrote:
> From: Simon Schampijer <simon at schampijer.de>
>
> When copying an entry to the storage device we set the title
> (filename) to _('Untitled').
>
> Conversion from 0.82 entries: If an entry has no title we set
> it to _('Untitled') and rename the file accordingly,
> taking care of creating a unique filename.
> ---
>  src/jarabe/journal/model.py |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
> index 98b7f09..81d115e 100644
> --- a/src/jarabe/journal/model.py
> +++ b/src/jarabe/journal/model.py
> @@ -23,6 +23,7 @@ import shutil
>  from stat import S_IFLNK, S_IFMT, S_IFDIR, S_IFREG
>  import re
>  from operator import itemgetter
> +from gettext import gettext as _
>
>  import gobject
>  import dbus
> @@ -540,6 +541,8 @@ def write(metadata, file_path='', update_mtime=True, transfer_ownership=True):
>             raise ValueError('Entries without a file cannot be copied to '
>                              'removable devices')
>
> +        if metadata['title'] == '':
> +            metadata['title'] = _('Untitled')
>         file_name = _get_file_name(metadata['title'], metadata['mime_type'])
>         file_name = _get_unique_file_name(metadata['mountpoint'], file_name)
>
> --
> 1.7.3.4
>
> _______________________________________________
> Dextrose mailing list
> Dextrose at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/dextrose
>



-- 
Anish


More information about the Dextrose mailing list