projects
/
pycalendar.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
55d2346
)
entry: Add an initial Entry implementation
author
W. Trevor King
<wking@tremily.us>
Sun, 30 Jun 2013 15:07:18 +0000
(11:07 -0400)
committer
W. Trevor King
<wking@tremily.us>
Sun, 30 Jun 2013 16:26:18 +0000
(12:26 -0400)
pycalendar/entry.py
[new file with mode: 0644]
patch
|
blob
diff --git a/pycalendar/entry.py
b/pycalendar/entry.py
new file mode 100644
(file)
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)