Opened 18 years ago
Last modified 5 years ago
#1596 new defect
New features
Reported by: | Owned by: | Christopher Lenz | |
---|---|---|---|
Priority: | normal | Component: | ExcelViewerPlugin |
Severity: | minor | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Hello
I modified Your plugin a bit and maybe You would like to include these changes.
Added few features:
- coloring of text and background (but it skips row/column format - only cell color or default)
- merging cells
- support for text weight and italic
- row identifiers - allows to create links in form attachment/wiki/Page/file.xls#row7
To extract these info it's necessary to have newest xlrd - 0.6.1. I'm not python programmer, so my code is crappy, but it works :-) Modified file is in attachment.
Attachments (1)
Change History (6)
Changed 18 years ago by
Attachment: | __init__.py added |
---|
comment:1 Changed 15 years ago by
Cc: | Ryan J Ollos added; anonymous removed |
---|
comment:2 follow-up: 3 Changed 15 years ago by
Trac Release: | 0.10 → 0.11 |
---|---|
Type: | enhancement → defect |
comment:3 Changed 15 years ago by
Replying to Myriam:
The replacement of __init__.py of zipped source by the attached file does not allow to have coloring text with trac 0.11.5.
Make sure to clear out your browser's cache. It probably still has the output of the previously viewed spreadsheet.I ran into the same issue and clearing the cache does refresh the color.
comment:4 Changed 15 years ago by
The color works great! Many thanks for sharing.
I found out that the plugin was skipping merged columns and empty rows including colored cells. I have made some changes to fix that. Here's the code fragment (see FIXME):
for crange in sheet.merged_cells: rlo, rhi, clo, chi = crange merged[(rlo,clo)]=(rhi-rlo,chi-clo) #colspan,rowspan for rx in xrange(rlo, rhi): for cx in xrange(clo, chi): skipped[(rx,cx)] = True skipped[(rx,0)] = False #FIXME: don'st skip column span skipped[(rlo,clo)] = False
Don't filter out rows with no cell value. It may have color.
for ridx in range(sheet.nrows): row = sheet.row(ridx) #FIXME: if not filter(lambda cell: unicode(cell.value), row): #FIXME: continue buf.append(u'<tr class="%s" id="row%d">' % (ridx % 2 and 'odd' or 'even', ridx + 1)) for cidx, cell in enumerate(row):
comment:5 Changed 5 years ago by
Cc: | Ryan J Ollos removed |
---|
The replacement of __init__.py of zipped source by the attached file does not allow to have coloring text with trac 0.11.5.