From: W. Trevor King Date: Sun, 30 Jun 2013 15:07:18 +0000 (-0400) Subject: entry: Add an initial Entry implementation X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=38db1e44ebebf247c21e2fb99d5d68a654f0648a;p=pycalendar.git entry: Add an initial Entry implementation --- diff --git a/pycalendar/entry.py b/pycalendar/entry.py new file mode 100644 index 0000000..692862a --- /dev/null +++ b/pycalendar/entry.py @@ -0,0 +1,19 @@ +# Copyright + +class Entry (object): + """An iCalendar entry (e.g. VEVENT) + """ + def __init__(self, type, content=None): + self.type = type + self.content = content + + def __str__(self): + if self.content: + return self.content.replace('\r\n', '\n').strip() + return '' + + def __repr__(self): + return '<{} type:{}>'.format(type(self).__name__, self.type) + + def write(self, stream): + stream.write(self.content)