from common import * from named import forwarders def gen_resolv_conf(node): return gen_header('resolv.conf') + """ search wleiden.net . nameserver 127.0.0.1 """ + "\n".join(map(lambda x: "nameserver %s" % x, forwarders)) if __name__ == "__main__": nodes = xml_to_obj_hierarchy(sys.argv[1]) ready_nodes_dtd_hierarchy(nodes) node = findnode(nodes, sys.argv[2]) print gen_resolv_conf(node)