From 38db1e44ebebf247c21e2fb99d5d68a654f0648a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 30 Jun 2013 11:07:18 -0400 Subject: [PATCH] entry: Add an initial Entry implementation --- pycalendar/entry.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pycalendar/entry.py 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) -- 2.26.2