view MoinMoin/filter/ @ 863:50a8b4a06abf

indexing filters: use single-quoted filenames to avoid problems with blanks
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 20 Jun 2006 21:03:04 +0200
parents 957d482215ac
children c907c2942372
line wrap: on
line source

# -*- coding: iso-8859-1 -*-
    MoinMoin - msexcel filter

    Depends on: "xls2csv" command from "catdoc" package
    @copyright: 2006 by ThomasWaldmann MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.

from MoinMoin import filter

def execute(indexobj, filename):
    data = filter.execfilter("xls2csv '%s'", filename)
    # xls2csv uses comma as field separator and "field content",
    # we strip both to not confuse the indexer
    data = data.replace(u',', u' ').replace(u'"', u' ')
    return data