[CalendarServer-changes] [292]
CalendarServer/trunk/twistedcaldav/ical.py
source_changes at macosforge.org
source_changes at macosforge.org
Mon Oct 23 21:31:07 PDT 2006
Revision: 292
http://trac.macosforge.org/projects/calendarserver/changeset/292
Author: wsanchez at apple.com
Date: 2006-10-23 21:31:07 -0700 (Mon, 23 Oct 2006)
Log Message:
-----------
minor
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/ical.py
Modified: CalendarServer/trunk/twistedcaldav/ical.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/ical.py 2006-10-24 04:30:44 UTC (rev 291)
+++ CalendarServer/trunk/twistedcaldav/ical.py 2006-10-24 04:31:07 UTC (rev 292)
@@ -35,13 +35,14 @@
import StringIO
from vobject import newFromBehavior, readComponents
-from vobject.base import Component as vComponent
+from vobject.base import Component as vComponent
from vobject.base import ContentLine as vContentLine
-from vobject.base import ParseError as vParseError
+from vobject.base import ParseError as vParseError
from vobject.icalendar import TimezoneComponent
from vobject.icalendar import stringToDate, stringToDateTime, stringToDurations
from vobject.icalendar import utc
+from twisted.python import log
from twisted.web2.stream import IStream
from twisted.web2.dav.util import allDataFromStream
@@ -214,6 +215,8 @@
else:
raise AssertionError("name may not be None")
+ # FIXME: _parent is not use internally, and appears to be used elsewhere,
+ # even though it's names as a private variable.
if "parent" in kwargs:
parent = kwargs["parent"]
@@ -238,7 +241,8 @@
def __ne__(self, other): return not self.__eq__(other)
def __eq__(self, other):
- if not isinstance(other, Component): return False
+ if not isinstance(other, Component):
+ return False
my_properties = set(self.properties())
for property in other.properties():
@@ -260,6 +264,7 @@
return True
+ # FIXME: Should this not be in __eq__?
def same(self, other):
return self._vobject == other._vobject
@@ -726,12 +731,8 @@
@raise ValueError: if the given calendar component is not valid for
use as a X{CalDAV} resource.
"""
- if self.name() != "VCALENDAR": raise ValueError("Not a calendar")
- if not self.resourceType(): raise ValueError("Unknown resource type")
+ self.validCalendarForCalDAV()
- version = self.propertyValue("VERSION")
- if version != "2.0": raise ValueError("Not a version 2.0 iCalendar (version=%s)" % (version,))
-
# Disallowed in CalDAV-Access-08, section 4.1
if self.hasProperty("METHOD"):
raise ValueError("METHOD property is not allowed in CalDAV iCalendar data")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061023/233941cb/attachment.html
More information about the calendarserver-changes
mailing list