xml: change from amara to lxml
[treecutter.git] / treecutter / directory.py
index dc60c379718e4a016c5fecc55eeb75610c5def31..19c4d8b4182cf4d4764d9ec77442a0473fd76839 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 import os
 import fnmatch
-from amara import bindery
+from lxml import etree
 import treecutter.constants as const
 
 class Directory():
@@ -15,9 +15,9 @@ class Directory():
             for filename in filenames:
                 if fnmatch.fnmatch(filename, '*.xml'):
                     file_ = os.path.join(dirname,filename)
-                    doc = bindery.parse(file_, prefixes=const.PREFIXES)
-                    title = doc.xml_select(u'/db:article/db:info/db:title')
-                    menu  = doc.xml_select(u'/db:article/db:info/db:titleabbrev')
+                    doc = etree.parse(file_)
+                    title = doc.xpath(u'/db:article/db:info/db:title',namespaces=const.XPATH)
+                    menu  = doc.xpath(u'/db:article/db:info/db:titleabbrev',namespaces=const.XPATH)
                     if title and menu:
                         base = file_.split('.')[1]
                         link = base.replace('index','')