~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/views.py

  • Committer: Ian Clatworthy
  • Date: 2008-08-07 14:19:34 UTC
  • mto: (4029.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 4030.
  • Revision ID: ian.clatworthy@canonical.com-20080807141934-oimoxsqgwgjxeo9g
centralise formatting of view file lists

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
    lookup_view = _not_supported
241
241
    set_view = _not_supported
242
242
    delete_view = _not_supported
 
243
 
 
244
 
 
245
def view_display_str(view_files, encoding=None):
 
246
    """Get the display string for a list of view files.
 
247
 
 
248
    :param view_files: the list of file names
 
249
    :param encoding: the encoding to display the files in
 
250
    """
 
251
    if encoding is None:
 
252
        return ", ".join(view_files)
 
253
    else:
 
254
        return ", ".join([v.encode(encoding, 'replace') for v in view_files])