summaryrefslogtreecommitdiff
path: root/xhtml2odt/xhtml2odt.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-04-21 15:43:25 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-04-21 15:43:25 +0200
commit6de79daabea26ff88b79b3ce402521ca454fe453 (patch)
tree8a5dd8b353e8570fa0871de3def4f1300f81848a /xhtml2odt/xhtml2odt.py
parent2b18ecd4e989446eafc3a01a06c9b43359f1ef6f (diff)
parent0855fa766848d72c181abc62ae44edbc6a553b57 (diff)
downloadIshtar-6de79daabea26ff88b79b3ce402521ca454fe453.tar.bz2
Ishtar-6de79daabea26ff88b79b3ce402521ca454fe453.zip
Merge branch 'stable' of lysithea.proxience.net:/home/proxience/git/ishtar into stable
Diffstat (limited to 'xhtml2odt/xhtml2odt.py')
-rwxr-xr-xxhtml2odt/xhtml2odt.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/xhtml2odt/xhtml2odt.py b/xhtml2odt/xhtml2odt.py
index aa387d54e..340a980cb 100755
--- a/xhtml2odt/xhtml2odt.py
+++ b/xhtml2odt/xhtml2odt.py
@@ -1,10 +1,12 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
-"""
+u"""
xhtml2odt - XHTML to ODT XML transformation
===========================================
Copyright (C) 2009-2010 Aurelien Bompard
+Copyright (C) 2015 Étienne Loks
This script can convert a wiki page to the OpenDocument Text (ODT) format,
standardized as ISO/IEC 26300:2006, and the native format of office suites such
@@ -257,7 +259,10 @@ class ODTFile(object):
:rtype: str
"""
xsl_dir = os.path.join(INSTALL_PATH, 'xsl')
- xslt_doc = etree.parse(os.path.join(xsl_dir, "xhtml2odt.xsl"))
+ tmpdirxsl = os.path.join(tempfile.mkdtemp(prefix="xhtml2odt-"), 'xsl')
+ shutil.copytree(xsl_dir, tmpdirxsl)
+
+ xslt_doc = etree.parse(os.path.join(tmpdirxsl, "xhtml2odt.xsl"))
transform = etree.XSLT(xslt_doc)
xhtml = self.handle_images(xhtml)
xhtml = self.handle_links(xhtml)