annotate MoinMoin/filter/application_vnd_ms_excel.py @ 3027:6dcc9617bab6

Fix for WrongAlignedAttachment (Thanks to Benjamin Weber) (ported from 1.6)
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 03 Feb 2008 17:57:42 +0100
parents 01f05e74aa9c
children 4e904da48c4c
rev   line source
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
2 """
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
3 MoinMoin - msexcel filter
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
4
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
5 Depends on: "xls2csv" command from "catdoc" package
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
6
1918
bb2e053067fb fixing copyright headers: remove umlauts (encoding troubles), make epydoc compatible, reformat
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1792
diff changeset
7 @copyright: 2006 MoinMoin:ThomasWaldmann
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
8 @license: GNU GPL, see COPYING for details.
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
9 """
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
10
1792
c907c2942372 Eclipse PyDev Check: fixed lots of its errors and warnings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 863
diff changeset
11 from MoinMoin.filter import execfilter
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
12
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
13 def execute(indexobj, filename):
1792
c907c2942372 Eclipse PyDev Check: fixed lots of its errors and warnings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 863
diff changeset
14 data = execfilter("xls2csv '%s'", filename)
470
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
15 # xls2csv uses comma as field separator and "field content",
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
16 # we strip both to not confuse the indexer
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
17 data = data.replace(u',', u' ').replace(u'"', u' ')
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
18 return data
957d482215ac lupy: some filters, update mode
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
19