paul@5 | 1 | #!/usr/bin/env python |
paul@5 | 2 | |
paul@10 | 3 | import codecs, vContent, os |
paul@5 | 4 | |
paul@10 | 5 | this_dir = os.path.split(__file__)[0] |
paul@10 | 6 | f = codecs.open(os.path.join(this_dir, "test.vcf"), encoding="utf-8") |
paul@7 | 7 | out = codecs.open("tmp.vcf", "w", encoding="utf-8") |
paul@7 | 8 | try: |
paul@7 | 9 | doc = vContent.iterparse(f) |
paul@8 | 10 | w = vContent.iterwrite(out) |
paul@7 | 11 | for name, parameters, value in doc: |
paul@7 | 12 | print "%r, %r, %r" % (name, parameters, value) |
paul@9 | 13 | w.write_content_line(name, parameters, value) |
paul@7 | 14 | finally: |
paul@7 | 15 | out.close() |
paul@7 | 16 | f.close() |
paul@5 | 17 | |
paul@5 | 18 | # vim: tabstop=4 expandtab shiftwidth=4 |