# Add build-timeout plugin setup for build dependencies #from lxml.etree import Element from lxml.etree import fromstring new_node = """\ 150 false """ def mangle(tree): if tree.xpath("//hudson.plugins.build__timeout.BuildTimeoutWrapper"): # Already there return tag = tree.xpath('/project/buildWrappers')[0] node = fromstring(new_node) tag.append(node) if node.getprevious(): node.getprevious().tail += " " node.tail = "\n "