tags 468624 + patch thanks On Thu, Aug 27, 2009 at 02:33:28AM +0100, Ben Hutchings wrote: > Sorry, that only covers the reduce-xml script. merge-lst-to-xml also > needs to be modified.
This patch should cover merge-lst-to-xml . Hence I'm tagging the bug +patch, but note that the actual patch should contain both mine and Ben's slices. The patch to port to the new etree module should be fine, but I'm unable to test the actual script as I don't know its logics. If someone can provide some test data, I'd happily put everything together and test Cheers. -- Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7 z...@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/ Dietro un grande uomo c'è ..| . |. Et ne m'en veux pas si je te tutoie sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime
--- merge-lst-to-xml.orig 2009-09-08 22:11:42.777558468 +0200 +++ merge-lst-to-xml 2009-09-08 22:18:59.330558360 +0200 @@ -4,7 +4,8 @@ import optparse import string -from elementtree import ElementTree, XMLTreeBuilder +from xml.etree import ElementTree +from xml.etree.ElementTree import XMLTreeBuilder class LstParser: """Parser for discover 1 device lists. Once initialized, the @@ -116,14 +117,14 @@ return False -class TreeBuilderWithComments(XMLTreeBuilder.FancyTreeBuilder): - """This class extends ElementTree's FancyTreeBuilder to +class TreeBuilderWithComments(XMLTreeBuilder): + """This class extends ElementTree's to parse comments, which no builder in ElementTree seems able to do by itself. """ def __init__(self): - XMLTreeBuilder.FancyTreeBuilder.__init__(self) + XMLTreeBuilder.__init__(self) self._parser.CommentHandler = self._comment def _comment(self, data):