def cleanMarkupSingle(raw, cleanerMethod): tree = getTreeFromMarkup(raw) buildAdvancedTree(tree) tc = TreeCleaner(tree, save_reports=True) tc.clean([cleanerMethod]) reports = tc.getReports() return (tree, reports)
def cleanMarkup(raw): print "Parsing %r" % (raw, ) tree = getTreeFromMarkup(raw) print "before treecleaner: >>>" showTree(tree) print "<<<" print '=' * 20 buildAdvancedTree(tree) tc = TreeCleaner(tree, save_reports=True) tc.cleanAll(skipMethods=[]) reports = tc.getReports() print "after treecleaner: >>>" showTree(tree) print "<<<" return (tree, reports)
def cleanMarkup(raw): print "Parsing %r" % (raw,) tree = getTreeFromMarkup(raw) print "before treecleaner: >>>" showTree(tree) print "<<<" print '=' * 20 buildAdvancedTree(tree) tc = TreeCleaner(tree, save_reports=True) tc.cleanAll(skipMethods=[]) reports = tc.getReports() print "after treecleaner: >>>" showTree(tree) print "<<<" return (tree, reports)