Major restructuring to get automatic decoding/encoding
[pycalendar.git] / pycalendar / component / event.py
diff --git a/pycalendar/component/event.py b/pycalendar/component/event.py
new file mode 100644 (file)
index 0000000..bf1c878
--- /dev/null
@@ -0,0 +1,65 @@
+# Copyright
+
+from . import base as _base
+
+
+class Event (_base.Component):
+    """A calendar event
+
+    As defined in :RFC:`5545`, section 3.6.1 (Event Component).
+    """
+    name = 'VEVENT'
+    required=[
+        'DTSTAMP',
+        'UID',
+        ]
+    optional=[
+        'DTSTART',  # required if VACLENDAR doesn't set METHOD
+        # must not occur more than once
+        'CLASS',
+        'CREATED',
+        'DESCRIPTION',
+        'GEO',
+        'LAST-MOD',
+        'LOCATION',
+        'ORGANIZER',
+        'PRIORITY',
+        'SEQUENCE',
+        'STATUS',
+        'SUMMARY',
+        'TRANSP',
+        'URL',
+        'RECURID',
+        # should not occur more than once
+        'RRULE',
+        # must not occur more than once
+        'DTEND',
+        'DURATION',  # but not when DTEND is also specified
+        # may occur more than once
+        'ATTACH',
+        'ATTENDEE',
+        'CATEGORIES',
+        'COMMENT',
+        'CONTACT',
+        'EXDATE',
+        'RSTATUS',
+        'RELATED',
+        'RESOURCES',
+        'RDATE',
+        'X-PROP',
+        'IANA-PROP',
+        ]
+    multiple=[
+        'ATTACH',
+        'ATTENDEE',
+        'CATEGORIES',
+        'COMMENT',
+        'CONTACT',
+        'EXDATE',
+        'RSTATUS',
+        'RELATED',
+        'RESOURCES',
+        'RDATE',
+        'X-PROP',
+        'IANA-PROP',
+        ]