692862a43c4bdc9edd340a3096903397bfa759a7
[pycalendar.git] / pycalendar / entry.py
1 # Copyright
2
3 class Entry (object):
4     """An iCalendar entry (e.g. VEVENT)
5     """
6     def __init__(self, type, content=None):
7         self.type = type
8         self.content = content
9
10     def __str__(self):
11         if self.content:
12             return self.content.replace('\r\n', '\n').strip()
13         return ''
14
15     def __repr__(self):
16         return '<{} type:{}>'.format(type(self).__name__, self.type)
17
18     def write(self, stream):
19         stream.write(self.content)