tags/icalDavid Bremnerby-nc-sa-2.5
Copyright 2020, David Bremner
https://www.cs.unb.ca/~bremner//tags/ical/David Bremnerikiwiki2008-07-05T23:57:28ZTrivial example using python to hack icalhttps://www.cs.unb.ca/~bremner//blog/posts/vobject-example/
<a href="../../whyCC/">by-nc-sa-2.5</a>
Copyright 2020, David Bremner
2008-07-05T23:57:28Z2008-06-01T03:00:00Z
<p>I could not find any nice examples of using the <a href="http://vobject.skyhouseconsulting.com/">vobject</a> class to
filter an icalendar file. Here is what I got to work. I'm sure there
is a nicer way. This strips all of the valarm subevents (reminders) from
an icalendar file.</p>
<pre><code>import vobject
import sys
cal=vobject.readOne(sys.stdin)
for ev in cal.vevent_list:
if ev.contents.has_key(u'valarm'):
del ev.contents[u'valarm']
print cal.serialize()
</code></pre>