[library-web] Explicitly use the minidom parser



commit 47e2dccc7675df7f2f1eb8165004d664840ed432
Author: William Jon McCann <william jon mccann gmail com>
Date:   Tue Feb 18 16:23:06 2014 -0500

    Explicitly use the minidom parser
    
    Newer versions seem to default to a different API.

 src/document.py           |    2 +-
 src/modtypes/gtkdoc.py    |    2 +-
 src/modtypes/htmlfiles.py |    2 +-
 src/overlay.py            |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/document.py b/src/document.py
index 96bb8ca..939e2ec 100644
--- a/src/document.py
+++ b/src/document.py
@@ -238,7 +238,7 @@ class RemoteDocument(Document):
                     os.stat(dst)[stat.ST_MTIME] > max(mtime_xsl, os.stat(filename)[stat.ST_MTIME])):
                 continue
 
-            parser = html5lib.HTMLParser()
+            parser = html5lib.HTMLParser(tree=html5lib.getTreeBuilder("dom"))
             doc = parser.parse(open(filename))
             doc.childNodes[-1].attributes['xmlns'] = 'http://www.w3.org/1999/xhtml'
             del doc.childNodes[:-1]
diff --git a/src/modtypes/gtkdoc.py b/src/modtypes/gtkdoc.py
index 31be29d..7e31478 100644
--- a/src/modtypes/gtkdoc.py
+++ b/src/modtypes/gtkdoc.py
@@ -120,7 +120,7 @@ class GtkDocModule(DocModule):
                         # to get library.gnome.org look
 
                         logging.debug('transforming files shipped with tarball')
-                        parser = html5lib.HTMLParser()
+                        parser = html5lib.HTMLParser(tree=html5lib.getTreeBuilder("dom"))
 
                         for filename in os.listdir(htmlfiles_dir):
                             src = os.path.join(htmlfiles_dir,filename)
diff --git a/src/modtypes/htmlfiles.py b/src/modtypes/htmlfiles.py
index 8cc5925..21d7460 100644
--- a/src/modtypes/htmlfiles.py
+++ b/src/modtypes/htmlfiles.py
@@ -83,7 +83,7 @@ class HtmlFilesModule(DocModule):
                 # to get library.gnome.org look
 
                 logging.debug('transforming files shipped with tarball')
-                parser = html5lib.HTMLParser()
+                parser = html5lib.HTMLParser(tree=html5lib.getTreeBuilder("dom"))
 
                 for filename in os.listdir(os.path.join(ext_dirname, self.dirname)):
                     src = os.path.join(ext_dirname, self.dirname, filename)
diff --git a/src/overlay.py b/src/overlay.py
index b8a9fb9..ce82a64 100644
--- a/src/overlay.py
+++ b/src/overlay.py
@@ -126,7 +126,7 @@ class Overlay:
             content = app.download(href + '?action=print', use_cache=False)
 
             # parse the wiki page and get all links in content
-            parser = html5lib.HTMLParser()
+            parser = html5lib.HTMLParser(tree=html5lib.getTreeBuilder("dom"))
             doc = parser.parse(file(content))
             del doc.childNodes[:-1]
             html = ET.fromstring(doc.toxml())


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]