How-To: export to non-XML syntax


toIcal.py uses the cwm API:

    # ...
    sts = load(addr)

    #...
        for cal in sts.each(pred = RDF.type, obj = ICAL.Vcalendar):
            w("BEGIN:VCALENDAR" + CRLF) #hmm... SAX interface?

            for comp in sts.each(subj = cal, pred = ICAL.component):
                if sts.statementsMatching(RDF.type, comp, ICAL.Vevent):
                    self.exportEvent(sts, comp)
                elif sts.statementsMatching(RDF.type, comp, ICAL.Vtimezone):
                    self.exportTimezone(sts, comp)
        
            w("END:VCALENDAR" + CRLF)