~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to MoinMoin/filter/application_vnd_oasis_opendocument.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
    Depends on: nothing (only python with zlib)
6
6
 
7
 
    @copyright: 2006-2009 MoinMoin:ThomasWaldmann
 
7
    @copyright: 2006 MoinMoin:ThomasWaldmann
8
8
    @license: GNU GPL, see COPYING for details.
9
9
"""
10
10
 
21
21
        data = zf.read("content.xml")
22
22
        zf.close()
23
23
        data = " ".join(rx_stripxml.sub(" ", data).split())
24
 
    except (zipfile.BadZipfile, RuntimeError), err:
25
 
        logging.error("%s [%s]" % (str(err), filename))
 
24
    except RuntimeError, err:
 
25
        logging.error(str(err))
26
26
        data = ""
27
 
    try:
28
 
        data = data.decode('utf-8')
29
 
    except UnicodeDecodeError:
30
 
        # protected with password? no valid OpenDocument file?
31
 
        data = u''
32
 
    return data
 
27
    return data.decode('utf-8')
33
28