#2669: excel/openoffice calc export
--------------------------------+-------------------------------------------
Reporter: anonymous | Owner: cboos
Type: enhancement | Status: reopened
Priority: normal | Milestone:
Component: ticket system | Version: devel
Severity: normal | Resolution:
Keywords: mimetype converter |
--------------------------------+-------------------------------------------
Comment (by cboos):
Let me first propose an implementation for the
pipelining stuff...
Here's the implementation on top of r3307:
attachment:pipelining_conversions.patch
I changed the `text/plain` MIME Type of the CSV
to `text/csv`, as this is the registered on (cf. rfc:4180).
The plugin would be extremely simple:
{{{
#!python
"""Convert any `text/csv` data to `application/vnd.ms-excel`."""
from trac.core import *
from trac.mimeview.api import IContentConverter
EXCEL_MIMETYPE = 'application/vnd.ms-excel'
class CSVToExcelConverter(Component):
implements (IContentConverter)
# IContentConverter methods
def get_supported_conversions(self):
yield ('excel', 'Excel', 'csv', 'text/csv', EXCEL_MIMETYPE, 8)
def convert_content(self, req, mimetype, content, k, fname=None,
url=None):
return (content, EXCEL_MIMETYPE)
}}}
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/2669>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets