Changeset 687

Show
Ignore:
Timestamp:
04/21/06 07:49:16 (3 years ago)
Author:
cmlenz
Message:

ExcelViewerPlugin:

Compatibility with Trac 0.9, skip empty sheets.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • excelviewerplugin/0.10/tracexcelviewer/__init__.py

    r686 r687  
    4242        for sheet_name in book.sheet_names(): 
    4343            sheet = book.sheet_by_name(sheet_name) 
     44            if not sheet.nrows: 
     45                continue # skip empty sheets 
    4446            buf.append(u'<table class="listing"><caption>%s</caption>\n' % 
    4547                       escape(sheet.name)) 
  • excelviewerplugin/0.9/tracexcelviewer/__init__.py

    r686 r687  
    4242        for sheet_name in book.sheet_names(): 
    4343            sheet = book.sheet_by_name(sheet_name) 
     44            if not sheet.nrows: 
     45                continue # skip empty sheets 
    4446            buf.append(u'<table class="listing"><caption>%s</caption>\n' % 
    4547                       escape(sheet.name)) 
     
    5557            buf.append(u'</tbody>') 
    5658            buf.append(u'</table>\n') 
    57         return u''.join(buf
     59        return (u''.join(buf)).encode('utf-8'