paul@5 | 1 | #!/usr/bin/env python |
paul@5 | 2 | |
paul@5 | 3 | import codecs, vCalendar |
paul@5 | 4 | |
paul@5 | 5 | f = codecs.open("tests/test.ics", encoding="utf-8") |
paul@7 | 6 | out = codecs.open("tmp.ics", "w", encoding="utf-8") |
paul@7 | 7 | try: |
paul@7 | 8 | doc = vCalendar.iterparse(f) |
paul@7 | 9 | w = vCalendar.vCalendarStreamWriter(out) |
paul@7 | 10 | for name, parameters, value in doc: |
paul@7 | 11 | print "%r, %r, %r" % (name, parameters, value) |
paul@7 | 12 | w.write(name, parameters, value) |
paul@7 | 13 | finally: |
paul@7 | 14 | out.close() |
paul@7 | 15 | f.close() |
paul@5 | 16 | |
paul@5 | 17 | # vim: tabstop=4 expandtab shiftwidth=4 |