view MoinMoin/filter/application_vnd_ms_excel.py @ 470:957d482215ac

lupy: some filters, update mode imported from: moin--main--1.5--patch-474
author Thomas Waldmann <tw@waldmann-edv.de>
date Mon, 13 Mar 2006 19:31:36 +0000
parents
children 50a8b4a06abf
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