view MoinMoin/filter/text_xml.py @ 6133:a6283e189869 tip

fixup: remove nonexisting passlib.utils._blowfish this was removed by the passlib 1.7.1 upgrade.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 01 Jun 2017 18:10:19 +0200
parents 0b220c040be4
children
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - text/xml file Filter

    @copyright: 2006 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
"""

import re

from MoinMoin import log
logging = log.getLogger(__name__)

from MoinMoin.filter.text import execute as textfilter

rx_stripxml = re.compile("<[^>]*?>", re.DOTALL|re.MULTILINE)

def execute(indexobj, filename):
    data = textfilter(indexobj, filename)
    try:
        data = " ".join(rx_stripxml.sub(" ", data).split())
    except RuntimeError, err:
        logging.error(str(err))
        data = ""
    return data