[Python-modules-commits] [python-odf] 21/118: Use expatreader directly

Wolfgang Borgert debacle at moszumanska.debian.org
Fri Oct 3 21:27:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to reference refs/remotes/upstream/master
in repository python-odf.

commit 241374d8162714038ca0f615d3db72218bc569b7
Author: Søren Roug <soren.roug at eea.europa.eu>
Date:   Wed Dec 10 20:11:57 2008 +0000

    Use expatreader directly
---
 contrib/tracplugins/0.10/README   | 5 +++++
 contrib/tracplugins/0.10/setup.py | 6 +++---
 odf/odf2xhtml.py                  | 7 +++++--
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/contrib/tracplugins/0.10/README b/contrib/tracplugins/0.10/README
index cad64a0..95cac99 100644
--- a/contrib/tracplugins/0.10/README
+++ b/contrib/tracplugins/0.10/README
@@ -1,2 +1,7 @@
 For some reason the script crashes on the make_parser() call in odf2xhtml.py,
 but only when called from Trac.
+
+To INSTALL:
+
+Run python setup.py bdist_egg
+Then copy the egg to the Trac plugin directory or Python's site-packages
diff --git a/contrib/tracplugins/0.10/setup.py b/contrib/tracplugins/0.10/setup.py
index 58c2700..0783743 100644
--- a/contrib/tracplugins/0.10/setup.py
+++ b/contrib/tracplugins/0.10/setup.py
@@ -1,14 +1,14 @@
 from setuptools import setup
 
-PACKAGE = 'OdfPreview'
+PACKAGE = 'OdfConversion'
 VERSION = '0.1'
 
-setup(name='OdfPreview',
+setup(name='OdfConversion',
       version='0.1',
       packages=['odfpreview','odftohtml'],
       author='Soren Roug',
       author_email='soren.roug at eea.europa.eu',
       description='A plugin for viewing ODF documents as HTML',
-      url='http://trac-hacks.org/wiki/OdfPreview',
+      url='http://trac-hacks.org/wiki/OdfConversion',
       entry_points={'trac.plugins': ['odfpreview.odfpreview=odfpreview.odfpreview',
        'odftohtml.odftohtml=odftohtml.odftohtml']})
diff --git a/odf/odf2xhtml.py b/odf/odf2xhtml.py
index b082691..229b930 100644
--- a/odf/odf2xhtml.py
+++ b/odf/odf2xhtml.py
@@ -22,7 +22,7 @@
 #pdb.set_trace()
 import zipfile
 import xml.sax
-from xml.sax import handler
+from xml.sax import handler, expatreader
 from xml.sax.xmlreader import InputSource
 from xml.sax.saxutils import escape, quoteattr
 
@@ -1258,7 +1258,10 @@ class ODF2XHTML(handler.ContentHandler):
         # Extract the interesting files
         z = zipfile.ZipFile(self._odffile)
 
-        parser = xml.sax.make_parser()
+        # For some reason Trac has trouble when xml.sax.make_parser() is used.
+        # Could it be because PyXML is installed, and therefore a different parser
+        # might be chosen? By calling expatreader directly we avoid this issue
+        parser = expatreader.create_parser()
         parser.setFeature(handler.feature_namespaces, 1)
         parser.setContentHandler(self)
         parser.setErrorHandler(handler.ErrorHandler())

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-odf.git



More information about the Python-modules-commits mailing list