#!/usr/bin/env python # -*- coding: utf8 -*- import sys import codecs from xml.etree.ElementTree import ElementTree from xml.etree.ElementTree import fromstring if __name__ == '__main__': tree = ElementTree() tree.parse("../konstruktikon-data/constructicon.xml") frames = set() entries = tree.findall("entry") for entry in entries: if entry.tag == "todo": continue the_id = entry.get("{http://www.w3.org/XML/1998/namespace}id") frames.add(the_id.encode("utf-8")) #for f in read_csv(num_of_fields=14): # frames.add(f[0]) print "generated_konstruktikon_entries = [%s];" % (",".join(map(lambda x: '"' + x + '"', frames)))