diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2015-04-21 13:41:35 +0000 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2015-04-21 13:41:35 +0000 | 
| commit | 20c3590369d736551d2d5e981cadc219e13bfc21 (patch) | |
| tree | ebf40073638c07059693733cb80678fbb1b94043 /xhtml2odt/xhtml2odt.py | |
| parent | d214b61d5bf2f3ea1bca24f7ac6a38ef53282992 (diff) | |
| download | Ishtar-20c3590369d736551d2d5e981cadc219e13bfc21.tar.bz2 Ishtar-20c3590369d736551d2d5e981cadc219e13bfc21.zip | |
Copy XSL files on a temporary directory before processing to prevent multi-thread clash
Diffstat (limited to 'xhtml2odt/xhtml2odt.py')
| -rwxr-xr-x | xhtml2odt/xhtml2odt.py | 9 | 
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) | 
